Need to eliminate GOTO in PHP script but dont know how
- by DomingoSL
Hello i have this code:
<?php
include("/LIB/error.php");
session_start();
if (isset($_POST['Submit1'])) {
if (!isset($_SESSION['token'])) {goto dale;}
if((time() - $_SESSION['token']) < 5) {
error('Debes esperar 5 segundos para poder enviar otra informacion.');
} else {
dale:
$_SESSION['token'] = time();
include("/LIB/HeadSQL.php");
include("/LIB/comprueba.php");
}
}
?>
I want to eliminate the GOTO instruction (because as you know is supported only in the last versions of php) in order to make more compatible my code, but i really cant figure out how to change the flow of the code without the GOTO. Thanks for your help.