Topic: Get HDD serial number and authentication scripts for rent License.
Hi, Bellow script is for PHP.
I want to create a script like this by My Visual Database which I want to apply for my project.
Please help me...
// this is for HDD authentication//
function GetVolumeLabel($drive) {
if (preg_match('#Volume Serial Number is (.*)\n#i', shell_exec('dir '.$drive.':'), $m)) {
$volname = ' ('.$m[1].')';
} else {
$volname = '';
}
return $volname;
}
$serial = str_replace("(","",str_replace(")","",GetVolumeLabel("c")));
echo "HDD No is:" .$serial. "<br>";
// Condition
$MyHDD = " BC3A-9B56";
if ($serial == $MyHDD) {
//echo 'true';
} else {
header('location: ---.com');
exit();
}
// Authentication for usage date
$Lic_day = 30;
$start = date_create('2021-04-26');
$end = date_create(); // Current time and date
$diff = date_diff( $start, $end );
/*
echo 'The difference is ';
echo $diff->y . ' years, ';
echo $diff->m . ' months, ';
echo $diff->d . ' days, ';
echo $diff->h . ' hours, ';
echo $diff->i . ' minutes, ';
echo $diff->s . ' seconds';
*/
$usage = $diff->days;
//echo 'The difference in days : ' . $diff->days;
if ($Lic_day >= $usage) {
echo 'Your License is Valid <br>';
} else {
header('location: ---.com');
exit();
}
//echo "Today is:" .$end. "<br>";
echo "License set for:" .$start. "<br>";
echo "Date Limit:" .$Lic_day. "<br>";
echo "Used Day:" .$usage. "<br>";
?>