Milice
Nutjob
Hello OTLanders, i got a really strange problem with fopen and fwrite. *Hoping someone here can help me*
Okay so this is my problem:
If i have a file that has this for example:
I can open it with fopen and it looks completely normal, but if i just save that again it puts this:
Im thinking but yet i haven't found any solution for it..
-Thx in advance ~Milice
Okay so this is my problem:
If i have a file that has this for example:
PHP:
$data = "iFailed";
PHP:
$data = \"iFailed\";
PHP:
case "saveedit":
$sfile = $_POST['sfile'];
$data = $_POST['data'];
$shandle = fopen($sfile, "w");
fwrite($shandle, $data);
fclose($shandle);
break;
PHP:
if($type == "edit"){
$ep = $_GET['file'];
$c = $_GET['c'];
$filename = realpath($poop.$ep);
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
echo "<center><font color=#fc863b4>".$filename."</font></center><br>";
//echo "On The Way! xD";
echo '<center><form action="?topic=saveedit" method="post"><input type="submit" value="Save!" style="background: #000001; color: #CC0000; border: 1px solid; border-color: #000000; text-align: center;"/><input type="hidden" name="sfile" id="sfile" value="'.$filename.'"/><br><textarea rows="30" cols="122" style="text-align: center; background: #000000; color: #CC0000;" name="data" id="data">' . htmlspecialchars($contents) . '</textarea>';
echo '</form></center>';
break;
}
-Thx in advance ~Milice
Last edited: