Jump to content

creating a user profile?


aarons123

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.