Time-Sensitive Form Example : _GET « Form « PHP





Time-Sensitive Form Example

 
<?
<FORM ACTION="index.php" METHOD=GET>
<INPUT TYPE="hidden" NAME="time" VALUE="<?php echo time(); ?>">
Enter your message (5 minute time limit):<INPUT TYPE="text" NAME="mytext" VALUE="">
<INPUT TYPE="submit" Value="Send Data">
</FORM>

if($_GET['time']+300 >= time()) {
     echo "You took too long!<BR>";
     exit;
}
?>
  
  










Related examples in the same category

1.Properly Checking for Submission Using Image Widgets
2.Using Arrays with Form Data in PHP
3.Reading Input from the Form