Hi, I am creating a membership website. So far I have gotten to the point were the person can register to my website.
They enter there username, password, firstname and lastname.
The firstname and lastname can be seen on the profile.php page when hey login for there eyes only, but I want them to be abl to have a user profile like this:
How can I do this?
This is what goes on there profile.php page when a user is logged in:
[php]echo "Welcome to your profile “; echo $_SESSION[‘valid_user’]; echo " !!!”;
echo “
”;
// localhost database Access Info
$host = ‘webhost.com’;
$user = ‘111’;
$pass = ‘0111111’;
$db = ‘111’;
//connect to database
$conn = mysql_connect($host,$user,$pass) or die(“cant open the connection”);
mysql_select_db($db) or die(“could not select db”);
//run the query
$query = “SELECT city
, firstname
,lastname
FROM authorised_users
WHERE name
=’”.$_SESSION[‘valid_user’]."’";
$result = mysql_query($query) or die(“error in $query query” . mysql_error());
//get the results as an array
$row = mysql_fetch_assoc($result) or mysql_error();
echo “
”;
// print firstname
echo "Your First Name: "; echo $row[‘firstname’];
echo “
”;
// print lastname
echo "Your Last Name: "; echo $row[‘lastname’];
echo “
”;
// print city
echo "City: "; echo $row[‘city’];[/php]