I have a user login authentication scrip which validates users emailid and password.
I want it to also check and validate users expiry date in the database.
I have user details like name, emailid, password, regdate, expiry (expiry date).
I want the autentication script to validate with emailid, password and expiry.
I want it to also check and validate users expiry date in the database.
I have user details like name, emailid, password, regdate, expiry (expiry date).
I want the autentication script to validate with emailid, password and expiry.
Code:
<?php
include "dbCon.php";
$EmailAd = $_POST['EmailAd'];
$Password = $_POST['Password'];
$query = mysql_query("SELECT * from user where EmailAd = '$EmailAd'
AND Password = '$Password'");
$row = mysql_fetch_array($query);
if ($row) {
session_start();
$_SESSION['EmailAd'] = $_POST['EmailAd'];
header ('Location: home.php');
exit();
}
else {
header ('Location: loginFailed.php');
exit();
}
?>
Comment