<?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 bugs@rootserver.lu
*/

$description = strip_tags(str_replace("http://","",$_POST['description']));
$url = htmlentities($_POST['url']);
$category = htmlentities($_POST['category']);
$username = htmlentities($_POST['username']);
$password = htmlentities($_POST['password']);

if (get_magic_quotes_gpc()) {

$text = htmlentities($_POST['text']);

} else  {

$text = htmlentities(str_replace("'","",$_POST['text']));

}



//Slash unh�nken an dateiendung unh�nken

$slash = '/';

$slcategory = $category . $slash;

$php ='.php';

$phplink = $description . $php;





//HTML Code gener�ieren



$fh = fopen($slcategory . $phplink,'wb');

//Variabel zrecksetzen

$category = $_POST['category'];

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">
//location.replace('index.php');
//</script>


?>


<script language="javascript">
location.replace('<?php print ($slcategory . $phplink); ?>');
</script>


