Hi,
Sorry for the delayed reply.
1. For the initial Server-Side validation, I would like to "POST" the installation date of the install to my current license database.
To achieve this you can simply create a PHP variable that will contain the date of the installation, then store that variable to your database like follows:
Code: Select all
$date=date("Y-m-d H:i:s");
mysql_query("INSERT INTO YourTable (Install_Date) VALUES ('$date')");
2. I would like the License Check to check the "Install_Date" row as well as the current date (server date) and if it is longer than 1 year, it will not allow an update installation, and if it is shorter than 1 year the install can proceed.
To achieve this you can verify if the "Install_Date" row already contains a value and if so, you can compare its value with the value of the current date:
Code: Select all
$user_sn=trim($_POST['sn']); // serial number entered by the user
$current_date=date("Y-m-d H:i:s");
$install_date;
$get_install_date = "SELECT Install_Date FROM YourTable WHERE sn = '$user_sn' "; // sn - the database row that contains the serial numbers
$result=mysql_query($get_install_date);
$row=mysql_fetch_array($result);
$install_date=$row['Install_Date'];
$date1 = strtotime($install_date);
$date2 = strtotime($current_date);
$secs = $datetime2 - $datetime1; // return the difference in seconds
$days = $secs / 86400; // compute the days
if($days > 365)
echo "License expired";
Let us know if this helped.
Best regards,
Eusebiu
FOLLOW US
Get the latest news in Application Packaging