On a real web host, they'll let you have a .htaccess file where you can disable them like so: php_value magic_quotes_gpc 0 (I keep saying "real web host" because I've just recently had to deal with a few web hosts that a client insisted on that didn't have a standard configuration and didn't support .htaccess files. I lost 6 hours of my life right before Christmas trying to work around that fact, and I can't get them back. If you find yourself in the same situation, vote with your feet and let such hosts die a horrible and bankrupt death.) On Sunday 14 January 2007 10:46 am, 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. > > > -----Original Message----- > > From: Beauford [mailto:phpuser@xxxxxxxxxx] > > Sent: January 14, 2007 11:34 AM > > To: 'PHP' > > Subject: RE: 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. > > > > > -----Original Message----- > > > From: Jim Lucas [mailto:lists@xxxxxxxxx] > > > Sent: January 14, 2007 1:02 AM > > > To: Beauford > > > Cc: PHP > > > Subject: Re: Stripslashes > > > > > > Beauford wrote: > > > > Hi, > > > > > > > > Anyone know how I can strip slashes from $_POST variables. I have > > > > tried about a hundred different ways of doing this and > > > > > > nothing works. > > > > > > > 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 a > > > > > > form, and it > > > > > > > appeared as O\'Toole. > > > > > > > > Thanks > > > > > > This is what I use, and it has worked ever time. > > > > > > if ( get_magic_quotes_gpc() ) { > > > $_POST = array_map("stripslashes", $_POST); } > > > > > > Jim Lucas > > > > -- > > PHP General Mailing List (http://www.php.net/) To > > unsubscribe, visit: http://www.php.net/unsub.php -- Larry Garfield AIM: LOLG42 larry@xxxxxxxxxxxxxxxx ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php