
October 12th, 2003, 03:20 AM
|
|
Contributing User
|
|
Join Date: Apr 2007
Posts: 4
Time spent in forums: 10 m 52 sec
Reputation Power: 0
|
|
|
passing variable with href link?
This is really an html question
How can I set and pass a variable as part of an html reference? What I am trying to do is have a number of html hyperlinks all linking to the same php page. Depending on which hyperlink is selected, the target page will change depending on what the variable set to.
I thought the following would work but it doesn’t seem to:
From the referring page
<a href=”targetpage.php?selection=1”>Selection 1</a> |
<a href=”targetpage.php?selection=2”>Selection 2</a>
Now in the targetpage.php
php Code:
Original
- php Code |
|
|
|
<?php if ($_GET[‘selection’]=1){ //Do something } else { //Do something different } ?>
With the above, I find the variable is always returning the value of 1 regardless of the selection.
Any suggestions on how I might get something like this to work?
|