Re: Stripslashes
| From: | Jim Lucas | Date: | Sun, 14 Jan 2007 17:27:05 +0000 |
| Subject: | Re: Stripslashes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-247077@lists.php.net to get a copy of this message | ||
Beauford wrote:
I just turned off get_magic_quotes in my PHP.ini, but not sure if the hosting company has it on or not once I upload the site.-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-----Original Message----- From: Beauford [mailto:phpuser@netscan.ca] Sent: January 14, 2007 11:34 AM To: 'PHP' Subject: RE: [PHP] Stripslashes I guess I'm just doing something wrong, 'cause that doesn't work either - nor do the hundreds of other snippets I've used. Here's the scenario. I have a form - after they submit the form it shows what they have entered, this is where I get the \. It also does it if the form redisplays after the user has input invalid data. All this is being done on the same page.nothing works.From: Jim Lucas [mailto:lists@cmsws.com] Sent: January 14, 2007 1:02 AM To: Beauford Cc: PHP Subject: Re: [PHP] Stripslashes Beauford wrote:-----Original Message-----Anyone know how I can strip slashes from $_POST variables. I have tried about a hundred different ways of doing this andHi,i.e. if(!empty($_POST)){ foreach($_POST as $x => $y){ $_POST[$x] = stripslashes($y); } } This came about after someone tried to enter O'Toole in aform, and itappeared as O\'Toole. ThanksThis is what I use, and it has worked ever time. if ( get_magic_quotes_gpc() ) { $_POST = array_map("stripslashes", $_POST); } Jim Lucas
do you have a way to look at the data in the DB, if so, look to see if the back slashes are in the db