Difference in post data between home and server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
WaterWolf
Forum Newbie
Posts: 3
Joined: Wed Jan 18, 2006 12:09 pm

Difference in post data between home and server

Post by WaterWolf »

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 ?
someberry
Forum Contributor
Posts: 172
Joined: Mon Apr 11, 2005 5:16 am

Post by someberry »

Probably just a variation in some settings in config.

I generally essentially do:

Code: Select all

<textarea name="x" cols="x" rows="x"><?PHP echo(htmlentities(stripslashes($_POST['x']))); ?></textarea>
sheila
Forum Commoner
Posts: 98
Joined: Mon Sep 05, 2005 9:52 pm
Location: Texas

Post by sheila »

It's called magic quotes and yes it's a configuration setting
http://www.php.net/manual/en/ref.info.p ... quotes-gpc
Post Reply