ThePayRoll
BANNED
- Dec 1, 2010
- 230
- 35
The problem is, I found this code on my machine from awhile ago, I don't know jack-shit worth of PHP, the problem is, when I post anything into the textbox ex:
this is what shows up in the file I create:
Does anyone know how to fix this? Basically just to remove the backslashes \
Here's the PHP code:
I know I can download the file I create and just remove the \ but that totally defeat's the purpose.
Anyone experienced in PHP know or have any idea on how to fix this?
Code:
<iframe src="http://google.com"></iframe>
this is what shows up in the file I create:
Code:
<iframe src=\"http://google.com\"></iframe>
Does anyone know how to fix this? Basically just to remove the backslashes \
Here's the PHP code:
Code:
<?PHP
if(isset($_POST['filename']))
{
$filename = $_POST['filename'];
$text = $_POST['text'];
$filename = "files/$filename"; #Must CHMOD to 666
}
?>
<html>
<head>
<title></title>
</head>
<body>
<?php
if(isset($_POST['filename']))
{
$fp = fopen ($filename, "w"); # w = write to the file only, create file if it does not exist, discard existing contents
if ($fp) {
fwrite ($fp, $text);
fclose ($fp);
echo ("File written");
}
else {
echo ("File was not written");
}
}else{
?>
<form name="form1" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
filename: <input name="filename" type="text" size="20">
<BR>
content:
<BR>
<TEXTAREA NAME="text" COLS=40 ROWS=6></TEXTAREA>
<BR>
<input type="submit" name="submit" value="save file">
</form>
<?php } ?>
</body>
</html>
I know I can download the file I create and just remove the \ but that totally defeat's the purpose.
Anyone experienced in PHP know or have any idea on how to fix this?