Ok, a little hard to explain...
This is usually found in a forum or a cms. Users have an id number 1,2,3... and forum threads also have an id number. I'm hoping to expand my PHP knowledge a little further! Currently to view someones profile, I have all users listed on a page along with a submit button next to each name which carries a hidden reference to the data in mysql. The submit button's hidden variable is stored as a session variable and passed to a profile.php page which queries the database to retrieve the data for that user.
Often, when viewing someone's profile say here on Tizag the website address is something like...
http://forums.tizag.com/member.php?u=6914
So my question is how do I get my setup to work like that?
Here's a quick script I put together to work on...
Assuming the above is the correct way to go about this, I still have no clue where to even start with the profile.php page!! If anyone can help that would be great!PHP Code:<?php
mysql_connect(localhost,user,password);
mysql_select_db(database);
$query = "SELECT * FROM users";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)){
echo '<a href="profile.php?u='.$row['id'].'">'.$row['firstname'].'</a>';
echo '<br />';
}
?>![]()
Thanks in advance.



Reply With Quote

Bookmarks