I'm going to go ahead and jump in here, its quite easy actually.
As long as you understand how to use $_SESSION,$_GET,$_POST,$_REQUEST(optional, not necessary)
but for profiles, concentrate on $_GET. Jmb was partially correct, but instead of doing that, why not just directly take the details from the user database rather than creating one more with duplicate fields and values?
Follow this,itssame :
For example, your database has a table called 'users' and its fields are username,rank,email.
Code :
CODE
<?php
//call in your connection file
require('connection2.php');
//Select from the database, the row which has the username of $_GET[profile] as give in the url. Example : url.com?a=account&s=session&profile=Test
$query=mysql_query("SELECT * FROM users WHERE username='$_GET[profile]'");
//Check the number of rows that are there in the database with the username of $_GET[profile], in this case Test is the account.
$count_rows=mysql_num_rows($query);
if ($count_rows >= 1) {
$r=mysql_fetch_array($query);
//above, we set $r to all the fields main display variable .
echo "Username : $r[username] \n";
echo "Email : $r[email] \n";
echo "Rank : $r[rank] \n";
}
else {
echo "No records of user.";
}
mysql_close(connection_variable);
?>
Thats the most basic script. You can modify it to your needs.
Comment/Reply (w/o sign-up)