Connecting Tech Pros Worldwide Help | Site Map

How can I get the value from another page??

Tim
Guest
 
Posts: n/a
#1: Jul 17 '05
In my case, I type <a href = 'decode.php?song=$choice'>Decode</a> in
one of the php file. But after I click the link, the decode.php page
can't get the value $choice, I would like to know the problem is and
how to solve it??
kingofkolt
Guest
 
Posts: n/a
#2: Jul 17 '05

re: How can I get the value from another page??


is the link that you gave in HTML mode or printed by a PHP print command? if
its in HTML mode (outside the <?php and ?> tags) then change that link to:

<a href='decode.php?song=<?php print $choice; ?>'>Decode</a>

otherwise the php parser doesnt know to interpolate the $choice variable
into the link. (you cant put php code directly in the HTML source. it has to
be seperated from HTML by <?php and ?> tags)

- JP

"Tim" <tim_li1008@sinaman.com> wrote in message
news:e5ae706f.0403191429.789e01e2@posting.google.c om...[color=blue]
> In my case, I type <a href = 'decode.php?song=$choice'>Decode</a> in
> one of the php file. But after I click the link, the decode.php page
> can't get the value $choice, I would like to know the problem is and
> how to solve it??[/color]


Closed Thread