[SOLVED] error in passing variable

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wenquxing
Forum Newbie
Posts: 9
Joined: Thu Dec 02, 2004 12:17 am

error in passing variable

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

try [php_man]stripslashes[/php_man]
wenquxing
Forum Newbie
Posts: 9
Joined: Thu Dec 02, 2004 12:17 am

Post by wenquxing »

thank you Phenom, now it's working. :)
Post Reply