I am having issues with my registration date.
I need to capture the registration date of a user and compute the expiry date but my script is not capturing both the date and expiry date.
I have posted my scripts here for you.
Please help.
I need to capture the registration date of a user and compute the expiry date but my script is not capturing both the date and expiry date.
I have posted my scripts here for you.
Please help.
Code:
<?php
if (isset($_POST['Submit'])) {
//$Bday = date("dd-mm-yyyy");
include "dbCon.php";
$EmailAd = $_POST['EmailAd'];
$Password = $_POST['Password'];
$Name = $_POST['Name'];
$Age = $_POST['Age'];
$Gender = $_POST['Gender'];
$Bday = $_POST['Bday'];
$Phone = $_POST['Phone'];
$College = $_POST['College'];
$Course = $_POST['Course'];
$Yr = $_POST['Yr'];
$UserType= $_POST['UserType'];
$Address= $_POST['Address'];
$Interest = $_POST['Interest'];
$Affiliation = $_POST['Affiliation'];
$Schedule = $_POST['Schedule'];
$About = $_POST['About'];
$Who = $_POST['Who'];
$now=date ("Y-m-d"); //store current date to a variable. this is used for scratch card expiration processes
$exp=date ("Y-m-d", mktime (0,0,0,date("m")+12,(date("d")+0),date("Y"))); //set expiry date of user to 12months the date of account creation
$query = mysql_query("INSERT into user (EmailAd, Password, Name, Age, Gender, Bday, Phone, College, Course, Yr, UserType, Address, Interest, Affiliation, Schedule, About, Who)
VALUES('$EmailAd', '$Password', '$Name', '$Age', '$Gender', '$Bday', '$Phone', '$College', '$Course', '$Yr', '$UserType', '$Address', '$Interest', '$Affiliation', '$Schedule', '$About', '$Who', Regdate='$now', expire='$exp'))");
// $sql= "INSERT INTO user SET Regdate='$now', expire='$exp'";
if ($query) {
session_start();
$_SESSION['EmailAd'] = $_POST['EmailAd'];
header ('Location: registerSuccess.php');
}
else {
echo ('Failed to Input Data');
}
}
?>
Comment