Jump to content

[SOLVED] FOPEN


maxudaskin

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

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.