Joshv1288 Posted August 5, 2008 Share Posted August 5, 2008 I Was Wondering how i can get my registration page to make the profile page after a user submits there information Link to comment https://forums.phpfreaks.com/topic/118300-solved-registration-to-profile-page/ Share on other sites More sharing options...
DarkWater Posted August 5, 2008 Share Posted August 5, 2008 Well, you assign a unique ID to each user, correct? Just pass it in the url to like, profile.php (i.e: profile.php?id=3) and then use $_GET['id'] to form a query. Link to comment https://forums.phpfreaks.com/topic/118300-solved-registration-to-profile-page/#findComment-608784 Share on other sites More sharing options...
trq Posted August 5, 2008 Share Posted August 5, 2008 You might find this helpfull. Link to comment https://forums.phpfreaks.com/topic/118300-solved-registration-to-profile-page/#findComment-608797 Share on other sites More sharing options...
Joshv1288 Posted August 5, 2008 Author Share Posted August 5, 2008 im using that code and i get this error Parse error: syntax error, unexpected T_ELSE in /home/h3swat/public_html/index.php on line 42 } else { echo "Query failed ". mysql_error(); } Link to comment https://forums.phpfreaks.com/topic/118300-solved-registration-to-profile-page/#findComment-608871 Share on other sites More sharing options...
trq Posted August 5, 2008 Share Posted August 5, 2008 There is a missing } just prior to the } else { in that code. It was untested (obviously). Link to comment https://forums.phpfreaks.com/topic/118300-solved-registration-to-profile-page/#findComment-608895 Share on other sites More sharing options...
Joshv1288 Posted August 5, 2008 Author Share Posted August 5, 2008 its there hers the whole code updated for my database $sql = "SELECT username FROM users"; $result = mysql_query($sql); if ($result) { if (mysql_num_rows($result) > 0) { // here we loop through each member in the database while ($row = mysql_fetch_assoc($result)) { /// creating a link out of there uname, and passing there uname through the url. echo "<a href=\"profiles.php?member={$row['username']}\">{$row['username']}</a><br />"; } } else { echo "No users found"; } else { echo "Query failed ".mysql_error(); } ?> Link to comment https://forums.phpfreaks.com/topic/118300-solved-registration-to-profile-page/#findComment-608902 Share on other sites More sharing options...
trq Posted August 5, 2008 Share Posted August 5, 2008 It still missing... $sql = "SELECT username FROM users"; $result = mysql_query($sql); if ($result) { if (mysql_num_rows($result) > 0) { // here we loop through each member in the database while ($row = mysql_fetch_assoc($result)) { /// creating a link out of there uname, and passing there uname through the url. echo "<a href=\"profiles.php?member={$row['username']}\">{$row['username']}</a><br />"; } } else { echo "No users found"; } } else { echo "Query failed ".mysql_error(); } ?> Consistent indentation is key to finding these errors. Link to comment https://forums.phpfreaks.com/topic/118300-solved-registration-to-profile-page/#findComment-609010 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.