Jump to content

Timer


Crew-Portal

Recommended Posts

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());
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.