Re: php help probably basic (used stripslashes but probably not the right way to do it)
| From: | David Robley | Date: | Tue, 11 Sep 2001 04:53:06 +0000 |
| Subject: | Re: php help probably basic (used stripslashes but probably not the right way to do it) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66848@lists.php.net to get a copy of this message | ||
On Tue, 11 Sep 2001 14:20, Lance Rochelle wrote:
> I am having the following problem.
> I have a database that is setup as follows
>
> CREATE TABLE test (
> id tinyint(4) NOT NULL auto_increment,
> text text NOT NULL ,
> PRIMARY KEY (id)
> ) TYPE=MyISAM;
>
> I have a page after a form that confirms all data to be entered the
> html is as follows
>
> text=\"test \'ve\"
> id=1
> <form action=./commitcard.php >
> <input type=hidden name=text value="\"test I\'ve\"">
If this isn't in an echo statement you shouldn't be escaping the double
quotes here. That should look more like
<input type=hidden name=text value="test I\'ve">
other wise what is seen is
<input type=hidden name=text value="\">
> <input type=hidden name=id value="1">
> <input type=submit name=submit value="Commit to database!">
> </form>
>
> however in the next page I am doing a print of the insert statement for
> testing and all I get is the following
> insert into test (id,text) values ('1','\')
>
> I have tried the following
> $test = stripslashes($test);
>
> but it just gets worse any ideas would be helpful
>
> I am using php 4.0.6, apache 1.3.20, mysql 3.23.42, and Linux kernel
> 2.4.3
>
>
> Lance Rochelle
> lrochelle@stny.rr.com
> http://ulands.idlegames.com
> (607) 775-2681
> -------------------------------------------
> Being a Systems Administrator is like
> hitting yourself in the bead with a brick.
> After a while you don't feel the pain.
> --------------------------------------------
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Not a real tagline, but an incredible soy substitute.