Jump to content

Loop Not Working?


monkeypaw201

Recommended Posts

I go to the following URL:

 

http://monkeypaw201.com/tmp/generate.php?first_flight=06:00&start_id=1&callsign_set=1000&callsign_start=50&from=San%20Diego%20International%20Airport&from_ica=KSAN&to=Los%20Angeles%20International%20Airport&to_icao=KLAX

 

and as you can see, it doesn't really work  :-\

 

the code is:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>

<body>
<?php
$first_flight = $_GET['first_flight'];
$start_id = $_GET['start_id'];
$callsign_set = $_GET['callsign_set'];
$callsign_start = $_GET['callsign_start'];
$ete = $_GET['ete'];
?>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td height="17" align="left">ID</td>
    <td align="left">CALLSIGN</td>
    <td align="left">CREATOR</td>
    <td align="left">FROM</td>
    <td align="left">FROM (ICAO)</td>
    <td align="left">TO</td>
    <td align="left">TO (ICAO)</td>
    <td align="left" sdnum="1033;0;HH:MM">ETE</td>
    <td align="left">ROUTE</td>
    <td align="left">DEPARTURE TIME</td>
    <td align="left">ARRIVAL TIME</td>
    <td align="left">AIRCRAFT</td>
    <td align="left">ACTIVE</td>
  </tr>
  <tr>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
  </tr>
<?php for ( $first_flight; $first_flight <= '12:00'; $first_flight += 10) { ?>
  <tr>
    <td><?php echo $start_id+1; ?></td>
    <td><?php echo $callsign_set+$callsign_start; ?></td>
    <td>Lorenzo Aiello</td>
    <td><?php echo $_GET['from']; ?></td>
    <td><?php echo $_GET['from_icao']; ?></td>
    <td><?php echo $_GET['to']; ?></td>
    <td><?php echo $_GET['to_icao']; ?></td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td> </td>
    <td><?php echo $_GET['aircraft']; ?></td>
    <td>Yes</td>
  </tr>
<?php } ?>
</table>
</body>
</html>

 

Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/103083-loop-not-working/
Share on other sites

sure, what its supposed to do;

 

ID - the ID column is supposed to increment by one for every row

 

CALLSIGN - Take the callsign set, add it to the callsign start number and iincrement by one for every row

 

CREATOR - Stays the same on every row

 

FROM - should display 'from' one the even rows and the 'to' on the odd rows

 

FROM (ICAO) - should display from_icao one the even rows and the to_icao on the odd rows

 

TO - should display 'to' one the even rows and the 'from' on the odd rows

 

TO (ICAO) - should display from_icao one the even rows and the to_icao on the odd rows

 

ETE - displays the ete (HH:MM) from the URL

 

ROUTE - displays to_route on even rows and from_route on odd rows

 

DEPARTURE TIME - the first row is just taken from the URL the other rows take the ARRIVAL TIME of the row before and add it to 'turnaround'

 

ARRIVAL TIME - the first row is just taken from the URL the other rows take the DEPARTURE TIME of the row before and add it to ete

 

AIRCRAFT - take from the URL

 

ACTIVE - static text

 

 

hope that clarifies..

Link to comment
https://forums.phpfreaks.com/topic/103083-loop-not-working/#findComment-528016
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.