Hello ive got a login form and when each person log's in i want there details to appear automatically in textboxes what kind of code do i require?? is it sessions not sure, there details are stored in a table called students in mysql database table :)

//do you login script here

//after user is logged in 
$username= $_SESSION['username'];

//after connecting to mysql
	$query  = "SELECT * FROM students WHERE username= '".$username."'";
	$result = mysql_query($query);	
        $row = mysql_fetch_array($result, MYSQL_ASSOC);

//row is array with all details. here are some examples
echo $row['name'];
echo $row['email'];
//or print all->
foreach($row as $r){ echo $r; }

for a more detailed answer and for a full login/logout/register/print details tutorial. see http://php.about.com/od/finishedphp1/ss/php_login_code.htm

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.