Hello,
I have a text box on my site that is submitted in a form using POST. However, I'm getting some discrepencies between the version running on my home machine and the version running on the server. When I enter the string How's it goin' ? "Are ya well ?" on my home machine the post data arrives exactly as I typed it but on the server the post data arrives with the characters already escaped eg. How\'s it goin\' ? \"Are ya well ?\" The home version is using PHP 5 running in IIS on WinXP. The server is using free BSD (or else it's linux, I'm not quite sure) and PHP 4.1 Are the differences being caused by the different PHP versions or by the different operating systems ? I need to store these values in the database but now I don't know when to escape characters and when to leave them...Any ideas ?
Difference in post data between home and server
Moderator: General Moderators
Probably just a variation in some settings in config.
I generally essentially do:
I generally essentially do:
Code: Select all
<textarea name="x" cols="x" rows="x"><?PHP echo(htmlentities(stripslashes($_POST['x']))); ?></textarea>It's called magic quotes and yes it's a configuration setting
http://www.php.net/manual/en/ref.info.p ... quotes-gpc
http://www.php.net/manual/en/ref.info.p ... quotes-gpc