Jump to content

Removing slashes


Kaboom

Recommended Posts

Okay were making an admin portal for our customers we do webdesign for but still host and for some reason it will not get rid of the \'s. Here's what I am using:

 

	$content = $_POST['content'];
$fh = fopen("$path", 'w') or $message = " <br /><font color=\"red\">Can't open file.</font><br />";
stripslashes ($content);
fwrite($fh, $content);
fclose($fh);
header("location: index.php");

 

It makes them redirect when it is done, shows an error if not, so ... why does it keep adding \'s? it can display it without them but it's randomly tossing it in there.

Link to comment
https://forums.phpfreaks.com/topic/205228-removing-slashes/
Share on other sites

A demo site of the code:

 

http://tyler.geeksnetwork.org/demo/index.php

 

goto the admincp and then you can edit the home.txt BUT when you do a link, <a href="" it makes it <a href\"\" even though I have strip slashes remove them... it only happens during post not load so if its in txt file already it works but if it isn't then you save with them it adds slashed and idk why.

Link to comment
https://forums.phpfreaks.com/topic/205228-removing-slashes/#findComment-1074229
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.