send a variable in a url
Posted: Tue Dec 01, 2009 6:01 am
in this script i connect to database and start session
from the search form collects data checks it the gets the appropriate data from database.
then displays it using code below
If you look particulary at this part im trying to send the id data recieved from database to the view.php
Can yopu tell me the correct way to do this
from the search form collects data checks it the gets the appropriate data from database.
then displays it using code below
Code: Select all
while($row=mysql_fetch_array($result))
{
$userid = $row["id"];
$photo = $row["photo"];
echo "<td><img src='http://www.url.co.uk/images/$photo'>";
echo '<a href='view.php?userid=$userid'>' . $row['username'] . '</a>';
echo '<strong>Location:</strong>' . $row['location'] . '<br>';
echo '<strong>Date of Birth:</strong>' . $row['dob'] . '</td>';
}
Code: Select all
echo '<a href='view.php?userid=$userid'>' . $row['username'] . '</a>';