Re: Add slashes saga

From: Date: Tue, 11 Mar 2003 15:39:57 +0000
Subject: Re: Add slashes saga
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-18976@lists.php.net to get a copy of this message
I've just been through this! Let's say that your variable containing the name is $lastname, using the following when setting up a form to pass values by POST worked for me: blah...blah...name='lastname' value ='".htmlentities(stripslashes($lastname))."'>..... etc etc I actually have a page where that variable is treated to stripslashes twice without the string being manipulated or called in any way in between, and yet it seems to need both instances. Don't ask me why or I'll start to whimper... Anyway, that's a starting point "Ron Herhuth" <Ron.Herhuth@tatumcfo.com> wrote in message news:503ABD6BCDA1B34D8FB05C65AC666CEF7372@exchange.tatumlink.com... I'm running into the old add slashes problem and I'm hoping someone might be nice enough to help me out. I created a form that lists all the last names in a database. Beside each name I have a checkbox which contains a value of their last name and because the user might select multiple names, I am assigning the values to an array (i.e. ...name="chkbox[]" value=O'brien...). I have the form set to pass the select values via a POST, with Register Globals OFF. On the following page I am printing out the selected names and in the example above (O'brien) the script only prints out "O" I lose the "'brien" which is problematic. I looked at the manual but I find it to be rather confusing on this point. What code can I put in place to help alleviate this problem? Thanks in advance! Ron

« previous php.windows (#18976) next »