aarons123 Posted November 2, 2008 Share Posted November 2, 2008 hello i have a basic game set up. but i would like to let them have a user profile that they can edit. and it shows there stats like, villages, coords, i would only need one of these, and i will code the rest myself any idea's? i have each player have a id like 1,2,3,4,5 so i would need away of showing there stats in there profile. and they can go see someones elses stats in someone elses profile. thanks Link to comment https://forums.phpfreaks.com/topic/131063-creating-a-user-profile/ Share on other sites More sharing options...
Flames Posted November 2, 2008 Share Posted November 2, 2008 for the view your profile link add everyones id. e.g. <a href="profile.php?id=<?php echo $id; ?>"> linky </a> then on the profile page add if(isset($_GET['id']) && is_numeric($_GET['id']) //checking if the id is set and it is a number { $id = $_GET['id']; } else { echo "Please pick a profile from below"; //get all character ids or something similar. } $sql = "SELECT * FROM mytable WHERE id='$id'"; $query = mysql_query($sql) or die(mysql_error()); $result = mysql_fetch_assoc($query); $stat1 = $result['stat1'] hope that helps Link to comment https://forums.phpfreaks.com/topic/131063-creating-a-user-profile/#findComment-680496 Share on other sites More sharing options...
bobbinsbro Posted November 2, 2008 Share Posted November 2, 2008 quick fix to Flames' code: note that there is a ")" missing at the end of the first line. Link to comment https://forums.phpfreaks.com/topic/131063-creating-a-user-profile/#findComment-680517 Share on other sites More sharing options...
Flames Posted November 2, 2008 Share Posted November 2, 2008 true, didnt notice it, im used to my editors adding the second bracket when i put it if you get what i mean. i press( and it puts a ) automatically (its like magic!) Link to comment https://forums.phpfreaks.com/topic/131063-creating-a-user-profile/#findComment-680523 Share on other sites More sharing options...
bobbinsbro Posted November 2, 2008 Share Posted November 2, 2008 same here. i can never use notepad again :'( Link to comment https://forums.phpfreaks.com/topic/131063-creating-a-user-profile/#findComment-680525 Share on other sites More sharing options...
waynew Posted November 2, 2008 Share Posted November 2, 2008 This sounds like a topic for the freelancing forum. Link to comment https://forums.phpfreaks.com/topic/131063-creating-a-user-profile/#findComment-680531 Share on other sites More sharing options...
Flames Posted November 3, 2008 Share Posted November 3, 2008 if it is i already want a fiver Link to comment https://forums.phpfreaks.com/topic/131063-creating-a-user-profile/#findComment-681359 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.