gud day,
i hope someone can assist me on what code needs to be added on my existing login script. once someone has gone through registering an account , there is a thank you message being displayed however i want it to be redirected to the login page in a specific time like 5 seconds.
How will I do that ?
here's the code the i have for my login page just in case you to see it...
many thanks...
<?php
include 'dbc.php';
$user_email = mysql_real_escape_string($_POST['email']);
if ($POST['Submit']=='Login')
{
$md5pass = md5($POST['pwd']);
$sql = "SELECT id,user_email FROM users WHERE
user_email = '$user_email' AND
user_pwd = '$md5pass' AND user_activated='1'";
$result = mysql_query($sql) or die (mysql_error());
$num = mysql_num_rows($result);
if ( $num != 0 ) {
// A matching row was found - the user is authenticated.
session_start();
list($user_id,$user_email) = mysql_fetch_row($result);
// this sets variables in the session
$_SESSION['user']= $user_email;
if (isset($_GET['ret']) && !empty($_GET['ret']))
{
header("Location: $_GET[ret]");
} else
{
header("Location: myaccount.php");
}
//echo "Logged in...";
exit();
}
header("Location: login.php?msg=Invalid Login");
//echo "Error:";
exit();
}
?>
<?php if (isset($GET['msg'])) { echo "<div class=\"msg\"> $GET[msg] </div>"; } ?>