Hello,
I'm trying to get a variable passed to another page via the URL. What I have right now is:
<a href="graph/graph.php?id=$store_number">
Then in the linked page I have:
$store = $_GET('$store_number');
I can't figgure out what I'm doing wrong. Any help would be awesome!
Using a variable in the URL
Moderator: General Moderators
Re: Using a variable in the URL
needs to be $_GEt['var'] instead of parenthesis
Re: Using a variable in the URL
I fixed it and now it seems like it's just passing a string.
The value that I get from that is "$store"
I'm getting the variable name instead of the value in the variable.
Main Page:
<a href="graph/graph.php?id=$store"> Graph </a>
Graph Page:
<?$value = $_GET['id'];?>
and echo of $value gives "$store"
The value that I get from that is "$store"
I'm getting the variable name instead of the value in the variable.
Main Page:
<a href="graph/graph.php?id=$store"> Graph </a>
Graph Page:
<?$value = $_GET['id'];?>
and echo of $value gives "$store"
Re: Using a variable in the URL
Never mind, I figgured it out.
<a href="graph/graph.php?id=<?=$store?>"> Graph </a>
<a href="graph/graph.php?id=<?=$store?>"> Graph </a>