Hi, sorry for the newbiness of my question! (learning for 3 days)
I am trying to link from a user list where a visitor will click a name on the list and be taken to that persons profile.
On the list I am using the following code to create the user ID link which works:
print "{$row['userid']}</td><td><a href='profile.php?u={$row['userid']}'>";
Here is the code on the profile page:
<?php
//start the session
session_start();
//check to make sure the session variable is registered
if(session_is_registered('myusername')){
}
else{
//the session variable isn't registered, send them back to the login page
header( "Location: /php/login.php" );
}
$_GET['u'];
require("header.php");
$result = mysql_query("SELECT * FROM user")
or die(mysql_error());
// store the record of the "example" table into $row
$row = mysql_fetch_array( $result );
// Print out the contents of the entry
print "<table border='1' align='center'><tr><td>Profile For <b></b>";
print $row['fname'];
print "<br><br /></td</tr></table>";
echo "<table border='1' bgcolor='#eeeeee' align='center' cellpadding='10' bordercolor='red'>";
echo "<tr><th>First Name</th><th> Last Name</th><th>Age</th></tr>";
echo "<tr><td>";
echo $row['fname'];
echo "</td><td>";
echo $row['lname'];
echo "</td><td>";
echo $row['age'];
echo "</td></tr>";
?>
What have I done wrong?
What should I add the my profiile page to make sure that the correct user is identified and shown?
Thanks in advance...