• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Windows Strange PHP Error

Milice

Nutjob
Joined
Oct 4, 2008
Messages
954
Solutions
2
Reaction score
157
Location
Sverige ;D
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:
PHP:
$data = "iFailed";
I can open it with fopen and it looks completely normal, but if i just save that again it puts this:
PHP:
$data = \"iFailed\";
Im thinking but yet i haven't found any solution for it..

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:
Back
Top