ChrisMartino Posted January 16, 2010 Share Posted January 16, 2010 This time i want to make a code so if somebody types "profile.php?member=123" it shows the members profile, This is how i show their own profile: if ($action == $Start) { ?> <center> <img src="<?=$_SESSION['AccountPic']?>" width="130" height="130"> <br /> <a href="profile.php?change=pic">[Change Picture]</a> </center> <br /> <?php echo "<b>Username:</b> $User"; ?> <br /> <?php echo "<b>IP Address:</b> $AccountIP"; ?> <br /> <?php echo "<b>Email Address:</b> $Email <a href=\"profile.php?change=email\">[Change]</a>"; ?> <br /> <?php echo "<b>Account Type:</b> $AccTyp"; ?> <br /> <?php if($AccountQurey == $Administrator) { echo "<b>Administrator:</b> Yes"; } else { echo "<b>Administrator:</b> No"; } } And i want to make it so it shows those but for the members id that they put in the address bar, How can i do that?, Also how could i list all registered members usernames? And the field that holds the members ID is "id" in the DB Link to comment https://forums.phpfreaks.com/topic/188705-query-the-db-for-users-id/ Share on other sites More sharing options...
ChrisMartino Posted January 16, 2010 Author Share Posted January 16, 2010 Anyone? Link to comment https://forums.phpfreaks.com/topic/188705-query-the-db-for-users-id/#findComment-996223 Share on other sites More sharing options...
phonydream Posted January 16, 2010 Share Posted January 16, 2010 You can access a variable from the url using the $_GET array. For example, the URL www.example.com?var1=thomas will give you a variable $_GET['var1'] that will be equal to thomas. Link to comment https://forums.phpfreaks.com/topic/188705-query-the-db-for-users-id/#findComment-996229 Share on other sites More sharing options...
ChrisMartino Posted January 16, 2010 Author Share Posted January 16, 2010 How would i do my if statement for it though?, I want to make is so " if("member" == "thereid")" :/ Link to comment https://forums.phpfreaks.com/topic/188705-query-the-db-for-users-id/#findComment-996269 Share on other sites More sharing options...
deth4uall Posted January 16, 2010 Share Posted January 16, 2010 SELECT * FROM `userinfo` WHERE `id` = '$id'; Link to comment https://forums.phpfreaks.com/topic/188705-query-the-db-for-users-id/#findComment-996277 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.