Thanks!
When a user logs in, I want the webpage to say " Hello User". I m unable to do this..Here is my code...I dunno whats the error...
Login Page Code:
<?
session_start();
include 'dbinfo.php';
// Conver to simple variables
$username = $_POST['username'];
$password = $_POST['password'];
if((!$username) || (!$password)){
echo "Please enter ALL of the information! <br />";
include 'index.php';
exit();
}
$password = md5($password);
$sql = mysql_query("SELECT * FROM users WHERE username='$username' AND password='$password'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
// Register some session variables!
session_register('username');
$_SESSION['username'] = $username;
session_register('email');
$_SESSION['email'] = $email;
mysql_query("UPDATE users SET last_login=now() WHERE userid='$userid'");
header("Location: login_success.php");
}
} else {
echo "<font color=red>You could not be logged in! The username and passsssword do not match!</font><br />
Please try again!<br />";
include 'index.php';
}
?>
Login Success Page : ( When the user successfully logs in the system...)
<?php
require 'config.php';
session_start();
echo "Welcome ". $_SESSION['username'] ."! <br /><br />";
?>
Why am i just getting just the "Welcome !" message

(
Thanks again