thanx! my magic_quotes_runtime is set to off.
actually, i managed to do a double stripslashes to my form fields eg.
stripslashes(stripslashes($field1)).. this worked well but still if the
input box is a textbox and i have a value that has a double quote ( " ) as
part of it, anything after the double quote gets cut off.. i looked at the
php.net site and tried things like htmlspecialchars and urlendecode but all
to no avail.
will appreciate advice! thanx thanx..
----- Original Message -----
From: "Justin Patrin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 04, 2003 2:26 PM
Subject: [PHP-DB] Re: Addslashes
> It's the magic quotes setting. Try setting magic_quote_gpc to off. Also,
> try turning magic_quotes_runtime off.
> Ng Hwee Hwee wrote:
> > hi all,
> > i'm really buffled by what i got and would appreciate any help possible!
although i addslashes and stripslashes, i still get a backslash ( \ )
character infront of a single inverted comma ( ' ) and also whenever an
amberscend ( & ) appears... please help! thanx thanx..
> > for example:
> > in my form (form.php), i have something like that:
> > <input type="text" name="field1" value="<? if ($form["field1"]) echo
> > upon submitting the form, the verification file (verify.php) will be
executed, and it has lines like that:
> > <?
> > session_register("form");
> > foreach($_POST as $varname => $value)
> > $form[$varname] = addslashes(trim(EscapeShellCmd($value)));
> > ?>
> > ... and then i'll check for the validity of field1. if there is an
error, the user will be redirected back to form.php with the value that the
user entered echoed with a stripslash.
> > if there is no error, the whole script runs well, but if the user has to
be brought back to form.php, it'll print backslashes infront of characters
like "( ) ' &" etc..
> > also, instead of having a blank text field, i have a text field with
contents retrieved from the database.. the database data does not have the
slashes and when the first time they appear on the screen, there is no
slashes attached too.. the problem is always when the user has an error and
needs to be brought back to form.php that the slashes appear and the number
of slashes doubles everytime the user has to be brought back to form.php.
> > i have my magic_quotes_gpc set to ON in my phpinfo() and my version of
php is 4.1.2.
> > thank you soo soo much!!
> > look forward to your replies.
> > hwee
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php