How to get data from php?id= on another page?

Jonathan

New member
it's been a while since i have programmed with php..
This is the code i have on my link page
<?php
$query = "SELECT id, initial, name FROM account WHERE top ='1' ";
$result = mysql_query($query);

while($row = mysql_fetch_array($result))
{
echo " <li><a href='http://www.xxxx.com/account.php?id={$row['id']}'> {$row['name']} </a></li> ";
}
?>

so the link is pointing to account.php?id=x

now on account.php
How can i recieve the data "id, initial, name" coming from what i got on that link..
and get it to use on account.php?id=x

what code do i use to get the id from the link and print out the id data??

i know you have to use "get" function or post or sth... can you help me with the code?
i think it consist of sth like $var1 = $_GET["name"];

can i get a whole code
 
You have it right. $_GET['']; is used to retrieve anything that is passed by the URL itself. How you get the information is always determined by how it's sent. On a form, it's defined by the method.

page.php?variable=value
$_GET['variable'] will equal value
 
Back
Top