Forum Moderators: coopster

Message Too Old, No Replies

More StripSlashes() strangeness

         

aspr1n

9:09 am on Dec 13, 2002 (gmt 0)

10+ Year Member



Anyone fancy having a go explaining this one?


<html>
<body>
<?php
$var = '4" x 10" Box';
echo StripSlashes( $var ) .'<br />';
?>
<input name="text" type="text" value="<?php echo StripSlashes( $var );?>" />
</body>
</html>

Certainly holds true in Phoenix 0.5, IE 6 and Opera 6.04

asp

aspr1n

9:15 am on Dec 13, 2002 (gmt 0)

10+ Year Member



Actually sorry guys a bit more playing with:


<body>
<?php
$var = '4" x 10" Box';
?>
<input name="text" type="text" value="<?php echo $var;?>" />
</body>
</html>

So it's not an SS problem, effectively the double quote (") is closing the tag in the form field ie.


<input name="text" type="text" value="4" x 10" Box" />

How would you guys escape this character problem, I can't see any way of doing this?

asp

aspr1n

9:19 am on Dec 13, 2002 (gmt 0)

10+ Year Member



Ok Friday morning, hungover, hence my thickness, scrub this post - answered my own question:

4&quot; x 10&quot; Box

asp

[ signature is now: "Think twice - post once"] ;)

lorax

4:32 pm on Dec 13, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



aspr1n,
Apologies for leaving you stranded. Been a bit busy this week with a handful of projects.

Gregg

aspr1n

11:54 pm on Dec 13, 2002 (gmt 0)

10+ Year Member



Gregg,

Nothing whatsoever to apologise for - I'm grateful for any help I get!

Thanks to your help, I've managed to understand rather than just accept - horse to water etc etc ;)

thanks again,

Neil