Hello, folks.
I got another problem.
Basically, I wanna check if someone is old enough to watch a movie.
I got 2 sessions - one for the certificate( 12, 15, 18) and 1 for the year of birth.
My question is can i use somtehing similiar to this or? Cause now is not working...
<?php
session_start();
if (!(isset($_SESSION["gatekeeper"]) && $_SESSION['gatekeeper'] !=''))
{
header("Location:mainpage.php");
echo "Not an user, leave";
}
else
{
echo "<center><h3>You are logged in as " . $_SESSION['gatekeeper'] . "</h3></center>";
// Read the quantity from the query string on the searchresult.php
$old = 2012 - $_SESSION['agez'];
if ($old < $_SESSION['certificate'])
{
echo "<script type ='text/javascript'> window.alert('Sorry, you are not old enough')</script>";
exit;
}
else
{
// Echo the form, with hidden fields containing the quanti
echo "<form method='post' action='buyfilm2.php' >";
echo "The quantity of tickets you want to buy?: <input name='maxtickets' value='1' />";
echo "<input type='hidden' name='id' value='$_GET[filmID]' /> ";
echo "<input type='submit' value='Go!' />";
}
}
?>