Crew-Portal Posted August 25, 2007 Share Posted August 25, 2007 I am trying to make a script that starts a timer once a process is filed and will not allow the script to continue if the session is registered! I want to set the timelimit to 30 minutes but I do not know how to do that. Also the script sees if the session is registered but doesnt do anything if it is or not it continues to the end and performs the function: if ($action == 'postflight'){ if ($_POST['depart'] == NULL){ $error = $tblstart . 'Go Back And Put A Departure!' . $tblend; include_once($index); } else { if ($_POST['arrival'] == NULL){ $error = $tblstart . 'Go Back And Put An Arrival!' . $tblend; include_once($index); } if ($_POST['distance'] == NULL){ $error = $tblstart . 'Go Back And Put A Distance!' . $tblend; include_once($index); } if (session_is_registered("plane")){ $error = $tblstart . 'You Have Already Filed A Flightplan Within The Last 1 (one) Hour!' . $tblend; include_once($index); } $connection = @mysql_connect("$db_host", "$db_user", "$db_pass") or die("Couldn't connect."); $db = @mysql_select_db($db_name, $connection) or die("Couldn't select database."); $plane = $_POST['plane']; session_register("plane"); $sql="INSERT INTO flights (PilotName, AircraftName, NbrPassengers, CargoWeight, DepartureIcaoName, ArrivalIcaoName, TotalDistance, TotalBlockTime) VALUES ('CMX-$valid_user', '$_POST[plane]', '$_POST[pass] PAX', '$_POST[cargo] KG', '$_POST[depart]', '$_POST[arrival]', '$_POST[distance] NM', '$_POST[hour]:$_POST[minute]')"; $error = $tblstart . 'Flight Sucessfully Posted!' . $tblend; include_once($index); $result = @mysql_query($sql,$connection) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno() . ") " . mysql_error()); } Quote Link to comment https://forums.phpfreaks.com/topic/66679-timer/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.