Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need the Age Verification - in PHP
#1
I'm not a PHP programmer, maybe someone can help me.Huh

I need to implement the age verification for the page with promotion of alcohol, roughly like this: www.russianstandardvodka.com, but only at PHP script.

Of course it has to be loaded before the Home page. If everything is OK, then we pass on ... if not, then an error message or «there is not of legal drinking age».

Following prioritize…
1.) Page loaded automatically in the language of the browser set (English is main).
2.) But there is a choice of languages, for example: EN, DE, ES, FR, IT, RU.
3.) It would be nice if this option is takes from the system in the form of a plugin. Thus, the text contents can be edited and accordingly fall immediately to the appropriate language version (if there is one, if NOT then in English).
4.) Need to do like “Remember me” function with ON/OFF check box (Session save in the Cookie).
If this very complicated, then from the 3rd and 4th paragraphs can opt-out.

I found the following script (slightly adjusted - ... verified working):

PHP Code:
<?php
$minAge
="18";
$minAge *= 3600*24*365.25## $minAge in seconds

$month=$_POST['Month']; ## Read Birthday from the form ##
$day=$_POST['Day'];
$year=$_POST['Year'];

$today_month=date("m"); ## Get the actual Date ##
$today_day=date("d");
$today_year=date("Y");

$dif_year=$today_year-$year;

if(
$dif_year<"110") { ## It's must be realy Age :-)) ##
if($dif_year>$minAge) { ## Year test ##
$auth="ok";
}
else if(
$dif_year==$minAge AND $month<$today_month){ ## Month test ##
$auth="ok";
}
else if(
$dif_year==$minAge AND $month==$today_month AND $tag<=$today_day){ ## Day test ##
$auth="ok";
}
if(
$auth=="ok") { ## Output // Ausgabe ##
echo "You can enter!";
}
else{
echo 
"Sorry, there is not of legal drinking age. You must be at least <b>18</b> to visit us!"## $minAge ##
}

}
else {
echo 
"You're not really ".$dif_year."! Please check your entries."## however, we would at kidding again ##
}
?>

unfortunately, my knowledge is't enough Sad
Reply
#2
Lightbulb 
I would like to pay to have it as a plugin - need it urgently.
If anyone is interested and can really develop this, then please contact me via PM (with details such as duration and cost).
[Image: evw3.png]
Thx a lot!
Reply




Users browsing this thread: 1 Guest(s)