Jump to content

Recommended Posts

<?php
						$page = $_GET['p'];
						if ($_GET['p'] == "board" || isset($_GET['searchfield'])){
						flights();
						}elseif($_GET['p'] == "file"){
						fileflight();
						}elseif($_GET['p'] == "map"){
						echo 'ERROR: Flight Map Cannot be Loaded.';
						}elseif($_GET['p'] == "book"){
						if(isset($_POST['bid_flight'])){
						$dept = $_POST['dept'];
						$dest = $_POST['dest'];

						$deptmetarf = file("http://weather.noaa.gov/pub/data/forecasts/taf/stations/".$dept.".TXT","r");
						$deptmetar  = $deptmetarf[1];

						$destmetarf = file("http://weather.noaa.gov/pub/data/forecasts/taf/stations/".$dest.".TXT","r");
						$destmetar  = $destmetarf[1];
						$route = $_POST['route'];
						$detailedroute = $_POST['detailedroute'];
						$my_t=getdate(date("U"));
						echo '<span class="fpln">';
						echo 'OOM'.$_SESSION["username"].' '.$_POST['dept'].'-'.$_POST['dest'].' '.$my_t[mday].'.'.$my_t[month].'.'.$my_t[year].'/'.$my_t[hours].''.$my_t[minutes];
						echo '<br />';
						echo '</span>';
$text = $_SESSION["username"].' '.$_POST['dept'].'/'.$_POST['dest'].' '.$my_t[mday].'.'.$my_t[month].'.'.$my_t[year].'/'.$my_t[hours].''.$my_t[minutes].'
FP '.$_POST['fltnum'].' '.$_POST['aircraft'].' '.$_POST['acftreg'].' '.$_SESSION['rank'].' '.$_SESSION['name'].'

RMKS
'.$rmks.'

'.$route.'

'.$detailedroute.'

METARS
Departure
'. $deptmetar .'

Dest
'. $destmetar ;
$filename = 'OOM'.$_SESSION["username"].'_'.$_POST['dept'].'-'.$_POST['dest'].'_'.$my_t[mday].' '.$my_t[month].' '.$my_t[year].'_'.$my_t[hours].''.$my_t[minutes].' '.$my_t[minutes].'.txt';
$file = fopen("../ops/fplns/".$filename,"w");
echo fwrite($file,$text);
fclose($file);
echo '<a href="fplns/'.$filename.'">Download Flight Plan</a>';
						}else{
						$fltnum = $_GET['f'];
						$book_data_sql = mysql_query("select * from flights WHERE flight_num = '{$fltnum}'");
						while($book_data = mysql_fetch_array($book_data_sql)){
						$dept = $book_data['depticao'];
						$dest = $book_data['desticao'];
						$aircraft = $book_data['aircraft'];
						$route = $book_data['route'];
						$detailedroute = $book_data['detailed_route'];
						}
						$regrand = rand(1,5);
						?>

 

There is some irrelevant HTML code below... it is just the form.

Link to comment
https://forums.phpfreaks.com/topic/84810-solved-fopen/#findComment-432383
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.