Page 1 of 1

Using a variable in the URL

Posted: Fri Jun 26, 2009 8:47 am
by hwmetzger
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!

Re: Using a variable in the URL

Posted: Fri Jun 26, 2009 8:55 am
by jazz090
needs to be $_GEt['var'] instead of parenthesis

Re: Using a variable in the URL

Posted: Fri Jun 26, 2009 9:48 am
by hwmetzger
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"

Re: Using a variable in the URL

Posted: Fri Jun 26, 2009 10:24 am
by hwmetzger
Never mind, I figgured it out.


<a href="graph/graph.php?id=<?=$store?>"> Graph </a>