Hey,
I'm making a simple file editor in php for php and it seems that PHP gets the ignore - ignores the content - I print it to a textarea, but when I click save I get magic quotes (\" where a quote is) so I've tried a number of things from the ini_set("magic_quotes_gpc","0"); to set_magic_quotes_runtime(0); and even StripSlashes($file); but the stuff just doesn't work...
Here is my code:
<?
//* Doesn't work - but keep for now
ini_set("magic_quotes_gpc","0");
set_magic_quotes_runtime(0);
//* Debug - remove later
$magic = get_magic_quotes_gpc();
print $magic;
$filename = "thisfile.php";
if (isset($newfile)) { StripSlashes($newfile); }
if (isset($file)) { StripSlashes($file); }
if (!isset($submit)){
$fd = fopen ($filename, "r");
$file = fread ($fd, filesize ($filename));
}
elseif ($submit){
$fp = fopen($filename, 'w');
$len = strlen($newfile);
fwrite($fp, $newfile);
$file = $newfile;
}
?>
<form action=edit.php method=get>
<textarea name=newfile cols=80 rows=20><? print $file; ?></textarea><br>
<input type=submit value=Save name=submit>
</form>
I bet thats not going to display properly ;-)
Thanx in Advanced!
Dane