Page 1 of 1

error in passing variable

Posted: Thu Dec 02, 2004 2:10 pm
by wenquxing
the original message is:

a:3:{i:0;a:6:{i:0;i:1;s:2:"ID";i:1;i:1;s:30:"news1 ";s:5:"title";s:30:"news1 ";i:2;s:200:"content1 ";s:7:"content";s:200:"content1 ";}
code is:

Code: Select all

$temp=serialize($info);
echo $temp;echo "<br>";echo "<br>";//$temp is the message I wanna pass
?>
<h1><a href="detail.php?foo=<?php echo urlencode($temp)?>">
but I got
a:3:{i:0;a:6:{i:0;i:1;s:2:\"ID\";i:1;i:1;s:30:\"news1 \";s:5:\"title\";s:30:\"news1 \";i:2;s:200:\"content1 \";s:7:\"content\";s:200:\"content1 \";}
when I decode it on the other page, so I can't unserialize the original message,
anyone can help?

Posted: Thu Dec 02, 2004 2:45 pm
by John Cartwright
try [php_man]stripslashes[/php_man]

Posted: Thu Dec 02, 2004 11:12 pm
by wenquxing
thank you Phenom, now it's working. :)