& missing in url

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
dlmaster
Forum Newbie
Posts: 1
Joined: Sat Jan 05, 2008 3:50 am

& missing in url

Post by dlmaster »

Hi,


PHP Code:
<a href="home.php?user=<?php echo $id ?>&adr=<?php echo $adr[$j]?>"><?php echo $tt[$j] ?></a><br>
PHP Code:
echo "<a href='home.php?user=$id&adr=$adr[$j]'>$tt[$j]</a><br>";

I have tried both of this code to pass the value of adr to the page mentioned but the & symbol is not in the url... I still cannoot get the value of adr using $_GET. 8O

In url box:

...home.php?user=abc&adr=def

but when mouse-over the link:

...home.php?user=abcadr=def


Is there anything wrong? I even try

<a href="home.php?user=<?php echo $id;?>&adr=<?php echo $adr[$j];?>"><?php echo $tt[$j]; ?></a><br>

I test on IE7, the & is visible but in the end I still cannot get the value using $_GET.

Please advise.... Thank you. :oops:
andylyon87
Forum Contributor
Posts: 168
Joined: Sat Jan 31, 2004 5:31 am
Location: Dundee

Post by andylyon87 »

Hey

You could repl the & with & to get it to work in a url

hope that helps
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Post by Jonah Bron »

Try testing the page without php.

Like

Code: Select all

<a href="home.php?user=5&adr=some_page.html">Some text</a>
And see if it still doesn't work.
Post Reply