Hello Devbest I was thinking its really easy to check Your age Before u enter the site,
Writing The Code.
// Lets First Make Some Sexy HTML!
// ok lets Stop right there. Know we gotta check if any Form has been Submitted yet
Writing The Code.
// Lets First Make Some Sexy HTML!
PHP:
<!html>
<head>
<title> Landing Page </title>
</head>
<body>
// ok lets Stop right there. Know we gotta check if any Form has been Submitted yet
PHP:
<?php
if (!isset($_POST['submit'])) {
?>
// this is the form will see if the submit hasnt been pushed yet
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Enter your age: <input name="age" size="2">
<input type="submit" name="submit" value="Go">
</form>
<?php
}//end if submited
else {
// display result
$age = $_POST['age'];
// this is a easy way of checking your age//
if($age >= 21)
{
$msg = 'Come on in, we have alcohol and music awaiting you!';
}
else
{
$msg = 'Sorry Your to young For this party D:';
// More Advance//
$msg = $age < 21 ? 'Your to young' : 'get your ass in here';
}
// that is how i do my if situations sorry :p
echo $msg;
}
?>