Can someone hook me up with the code for this? I want it to set an ID automatically after someone submits a registratoin form and creates a username for my webpage. Any help would be appreciated. Thanks.
Creating ID's
Moderator: General Moderators
-
sk8erh4x0r
- Forum Commoner
- Posts: 43
- Joined: Wed May 26, 2004 8:27 pm
Creating ID's
I'm trying to set up ID's for each user on my website. I want it to show as something like .../userinfo.php?ID=user_here
Can someone hook me up with the code for this? I want it to set an ID automatically after someone submits a registratoin form and creates a username for my webpage. Any help would be appreciated. Thanks.
Can someone hook me up with the code for this? I want it to set an ID automatically after someone submits a registratoin form and creates a username for my webpage. Any help would be appreciated. Thanks.
Last edited by sk8erh4x0r on Wed May 26, 2004 8:34 pm, edited 1 time in total.
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Get the id value from the url, use it in a database query and print the results:
Code: Select all
$result = mysql_query("SELECT * FROM users WHERE id = '".$_GET['id']."'");
$row = mysql_fetch_assoc($result);
echo "User: ".$row['username']." <br>Date Joined: ".$row['date_joined'];