Page 1 of 1

Trouble with a dynamic link to a dynamic page

Posted: Sun Mar 25, 2007 8:59 pm
by davidtube
Hi, I'm new here, please don't hurt me. I've hunted around and can't find the answer


I've got this code which produces a list of links. I'm having trouble working out how to know what link the user has clicked on.

Code: Select all

while ($rows=mysql_fetch_array($modulelist))
{
$_SESSION[module]=$rows[ModuleName];
echo "<a href='lecture.php'>" . $rows[ModuleName] . "</a><br>";
}
With this i hoped I could use $_SESSION on the next page in a query, but unfortunately, $_SESSION only contains the name of the last module on the list no matter which is clicked.

I know i could change the URL but i don't know how to get the variable to read from the URL

I'd really appreciate any help. Thanks :)

Posted: Sun Mar 25, 2007 10:08 pm
by Skara
I know i could change the URL but i don't know how to get the variable to read from the URL
page.php?somevar=foo

Code: Select all

$blah = $_GET['somevar']

Posted: Sun Mar 25, 2007 10:54 pm
by davidtube
:) Thanks it's working now.