<?php
/*
Letzlink Release 1.4.1
(C) Jean Schumacher 2007 - 2011.
This free software is released under CC GNU - GPL2 ( General Public License )
Your are completely free to use it, alter or change it or to distribute it
as log you are in accordance with the GNU - GPL2 license which is distributed
along with this software.
More information can be found at http://www.creativecommons.org/licenses/GPL/2.0
Attention: The software was mainly developed to be run on localhost or LAN Systems.
If you run it on public accessible areas, this may be a security risk, especially
if the software is not protected with appropriate software to limit access.
Please report any bug to hide@address.com
*/
$description = stripslashes(strip_tags(str_replace("http://","",$_POST['description'])));
$description = str_replace("/","",$description);
$description = str_replace("ö","oe",$description);
$description = str_replace("ü","ue",$description);
$description = str_replace("é","e",$description);
$description = str_replace("ä","ae",$description);
$description = str_replace("è","e",$description);
$description = str_replace("Ã","Oe",$description);
$description = str_replace("Ã","Ue",$description);
$description = str_replace("Ã","Ae",$description);
$description = str_replace("Ã ","a",$description);
$url = htmlentities($_POST['url']);
$category = htmlentities($_POST['category']);
$username = htmlentities($_POST['username']);
$password = htmlentities($_POST['password']);
if (preg_match('([^\s+-_a-zA-Z0-9]+)',$description)) {
print<<<OUTPUT
<html><head>
<script language="javascript">
location.replace('addlink3.php');
</script>
</head>
</html>
OUTPUT;
} else {
if (get_magic_quotes_gpc()) {
$text = htmlentities($_POST['text']);
} else {
$text = htmlentities(str_replace("'","",$_POST['text']));
}
if (strlen($_POST['description']) == 0) {
print<<<_HTML_
<script language="javascript">
location.replace('addlink2.php');
</script>
_HTML_;
} else {
$entry = "<?php";
$entry1a ='$user1a[]= "';
$entry1b ='$user1b[]= "';
$entry1c ='$user1c[]= "';
$entry1d ='$user1d[]= "';
$entry2 ="<a href='$category/$description.php'>$description</a>";
$entry3 ='";';
$entry4 ="?>";
$entry5 ="\n";
$add = "2";
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
if (file_exists("$category/$description.php")) {
$add = $add++;
$description = $description . $add;
$entry2 ="<a href='$category/$description.php'>$description</a>";
}
//Linken Aschreiwen
if ($category == 'Personal') {
$fh = fopen('Personal/link.php','a');
fwrite($fh, "$entry $entry1a $entry2 $entry3 $entry4 $entry5");
fclose($fh);
}elseif ($category == 'Business') {
$fh = fopen('Business/link.php','a');
fwrite($fh, "$entry $entry1b $entry2 $entry3 $entry4 $entry5");
fclose($fh);
}elseif ($category == 'Software') {
$fh = fopen('Software/link.php','a');
fwrite($fh, "$entry $entry1c $entry2 $entry3 $entry4 $entry5");
fclose($fh);
}elseif ($category == 'Other') {
$fh = fopen('Other/link.php','a');
fwrite($fh, "$entry $entry1d $entry2 $entry3 $entry4 $entry5");
fclose($fh);
}
//Slash unh nken an dateiendung unh nken
$slash = '/';
$slcategory = $category . $slash;
$php ='.php';
$phplink = $description . $php;
//PHP Fichieren kr eiren
touch ($slcategory . $phplink);
//HTML Code gener ieren
$fh = fopen($slcategory . $phplink,'wb');
fwrite($fh,
"<html>
<head>
<link rel='stylesheet' type='text/css' href='../style.css'>
</head>
<body>
<br>
<h3 align='center'>Info Details <?php print '$description'; ?></h3>
<br>
<table align='center' width='500' height='250' border='1' bgcolor='white'>
<tr>
<td>Location: <a href='<?php print '$url'; ?>' target='_blank'><?php print '$url'; ?></a></td></tr>
<tr>
<td>Username: <?php print '$username'; ?></td></tr>
<tr>
<td>Password: <?php print '$password'; ?></td></tr>
<tr>
<td align='center'>Details:<br> <textarea cols = 65 rows = 10 name ='text2'style='font-family:Arial; color:blue;'><?php print '$text'; ?></textarea></td></tr></table>
<table align='center' width = '450'>
<tr><td>
<form method='POST' action ='modify.php'>
<input type='submit' value ='Modify Record'><br>
<input type = 'text' name='description' value='$description' style='visibility:hidden;'><br>
<input type = 'text' name='url' value='$url' style='visibility:hidden;'><br>
<input type = 'text' name='category' value='$category' style='visibility:hidden;'><br>
<input type = 'text' name='username' value='$username' style='visibility:hidden;'><br>
<input type = 'text' name='password' value='$password' style='visibility:hidden;'><br>
<textarea name='text'style='visibility:hidden;'>$text</textarea></form></td>
<td valign='top'>
<form method='POST' action ='pdf.php'>
<input type='submit' value ='Create PDF'>
<input type = 'text' name='description' value='$description' style='visibility:hidden;'><br>
<input type = 'text' name='url' value='$url' style='visibility:hidden;'><br>
<input type = 'text' name='category' value='$category' style='visibility:hidden;'><br>
<input type = 'text' name='username' value='$username' style='visibility:hidden;'><br>
<input type = 'text' name='password' value='$password' style='visibility:hidden;'><br>
<textarea name='text'style='visibility:hidden;'>$text</textarea></td>
<td valign='top'><input onclick='javascript:self.print()' type='button' value='Print Record'></td>
</tr></table><br>
</body>
</html>
");
fclose($fh);
}
}
?>
<script language="javascript">
parent.location.replace('index.php');
</script>