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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
trq Posted August 5, 2008 Share Posted August 5, 2008 You might find this helpfull. Quote Link to comment 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(); } Quote Link to comment 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). Quote Link to comment 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(); } ?> Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.