Jump to content

Recommended Posts

if(!isset($adminid) || !isset($adminpass) || !isset($position)) {
header("Location: index.php");
}

$pilotid = $row['pilotID'];

$id = $_GET['id'];

 

That's what's before and after it.

this code is irrelevant without the header, oh my there are some characters on phpf today!

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252682
Share on other sites

That comes later. It's a lot of code. But basically, if the query works, it goes to that page. I'll post the whole code.

 

if(!isset($adminid) || !isset($adminpass) || !isset($position)) {
header("Location: index.php");
}

$pilotid = $row['pilotID'];

$id = $_GET['id'];

$sql = "SELECT * FROM pireps WHERE id=$id";

$result = mysql_query($sql);

$row = mysql_fetch_array($result);

if (isset($_POST['submit'])) {
$flight = mysql_escape_string($_POST['flight']);
$dept = mysql_escape_string(strtoupper($_POST['dept']));
$arrival = mysql_escape_string(strtoupper($_POST['arrival']));
$flightTime = mysql_escape_string($_POST['flightTime']);
$fuel = mysql_escape_string($_POST['fuel']);
$aircraft = $_POST['aircraft'];
$status = $_POST['status'];
$comments = $_POST['comments'];

if (empty($flight)) {
$errors .= "Please enter the flight number. <br />";
}
if (empty($dept)) {
$errors .= "Please enter the departure airport. <br />";
}
if (empty($arrival)) {
$errors .= "Please enter the arrival airport. <br />";
}
if ($flightTime == "") {
$errors .= "Please enter the flight time. <br />";
}
if (empty($fuel)) {
$errors .= "Please enter the fuel. <br />";
}

if ($errors == "") {

$sql2 = "UPDATE pireps SET flight = '$flight', $dept = '$dept', arrival = '$arrival', flightTime = '$flightTime', fuel = '$fuel', aircraft = '$aircraft', status='$status' comment = '$comment' WHERE id='$id'"
or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error());

$result2 = mysql_query($sql2);

header("Location: logbook.php?pid=" . $pilotid);
} else {}
}
?>

 

The update doesn't work anyway, but that's for another topic. lol

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252687
Share on other sites

The update doesn't work anyway, but that's for another topic. lol

 

Probably has at least something to do with this: $dept = '$dept',

 

Every time you use a header() redirect, it should be immediately followed by a call to exit() to stop any further execution of code in the script.

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252693
Share on other sites

what i notice is that you do not initiate the $errors variable before trying to concatenate values onto it..

 

$errors = ""; if (empty($flight)) {$errors .= "Please enter the flight number. <br />";}if (empty($dept)) {$errors .= "Please enter the departure airport. <br />";}if (empty($arrival)) {$errors .= "Please enter the arrival airport. <br />";}if ($flightTime == "") {$errors .= "Please enter the flight time. <br />";}if (empty($fuel)) {$errors .= "Please enter the fuel. <br />";}if ($errors == "") {$sql2 = "UPDATE pireps SET flight = '$flight', $dept = '$dept', arrival = '$arrival', flightTime = '$flightTime', fuel = '$fuel', aircraft = '$aircraft', status='$status' comment = '$comment' WHERE id='$id'"or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error());$result2 = mysql_query($sql2);header("Location: logbook.php?pid=" . $pilotid);} else {}}

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252720
Share on other sites

okay, $pilotid should be usable throughout the entire script since it is defined in the global scope...as to the reason your update query is not working, you have storing the "or die" part in your variable too, then trying to query that as well, should be written as such

 

if ($errors == "") 
{
$sql2 = "UPDATE pireps SET flight = '$flight', dept = '$dept', arrival = '$arrival', flightTime = '$flightTime', fuel = '$fuel', aircraft = '$aircraft', status='$status' comment = '$comment' WHERE id='$id'"
$result2 = mysql_query($sql2) or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error());
header("Location: logbook.php?pid=" . $pilotid);
} else {}

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252740
Share on other sites

I added that but when it redirects, it still goes to logbook.php without the pid. I echoed the query and found that the problem is that it can't find the id part. But I don't know why because earlier in the script, I use $id and it works perfectly fine. Here's my full script with your add-on AyKay.

 

<?php

session_start();

require 'include/sql.php';

$errors = "";

$adminid = $_SESSION['adminid'];
$adminpass = $_SESSION['adminpass'];
$position = $_SESSION['position'];

if(!isset($adminid) || !isset($adminpass) || !isset($position)) {
header("Location: index.php");
}

$pilotid = $row['pilotID'];

$id = $_GET['id'];

$sql = "SELECT * FROM pireps WHERE id=$id";

$result = mysql_query($sql);

$row = mysql_fetch_array($result);

$flightNum = $row['flight'];
$departure = $row['dept'];
$arrivalAirport = $row['arrival'];
$hours = $row['flightTime'];
$fuelUsed = $row['fuel'];
$aircraftUsed = $row['aircraft'];
$statusPirep = $row['status'];
$pilotComment = $row['comment'];

if (isset($_POST['submit'])) {
$flight = mysql_escape_string($_POST['flight']);
$dept = mysql_escape_string(strtoupper($_POST['dept']));
$arrival = mysql_escape_string(strtoupper($_POST['arrival']));
$flightTime = mysql_escape_string($_POST['flightTime']);
$fuel = mysql_escape_string($_POST['fuel']);
$aircraft = $_POST['aircraft'];
$status = $_POST['status'];
$comments = $_POST['comments'];

$sql2 = "UPDATE pireps SET flight='$flight', dept='$dept', arrival='$arrival', flightTime='$flightTime', fuel='$fuel', aircraft='$aircraft', status='$status', comments='$comment' WHERE id='$id'";

$result2 = mysql_query($sql2) or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error());;header("Location: logbook.php?pid=" . $pilotid);

} else {}

?>

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252744
Share on other sites

you are using a query value in $pilotid before actually calling the query..

 

$id = $_GET['id'];
$sql = "SELECT * FROM pireps WHERE id=$id";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$pilotid = $row['pilotID']; //specify pilotid here
$flightNum = $row['flight'];
$departure = $row['dept'];
$arrivalAirport = $row['arrival'];
$hours = $row['flightTime'];
$fuelUsed = $row['fuel'];
$aircraftUsed = $row['aircraft'];
$statusPirep = $row['status'];
$pilotComment = $row['comment'];

 

then your logbook.php should have the pid appended correctly

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252752
Share on other sites

<?php

session_start();

require 'include/sql.php';

$errors = "";

$adminid = $_SESSION['adminid'];
$adminpass = $_SESSION['adminpass'];
$position = $_SESSION['position'];

if(!isset($adminid) || !isset($adminpass) || !isset($position)) {
header("Location: index.php");
}



$id = $_GET['id'];

$sql = "SELECT * FROM pireps WHERE id=$id";

$result = mysql_query($sql);

$row = mysql_fetch_array($result);

$pilotid = $row['pilotID'];
$flightNum = $row['flight'];
$departure = $row['dept'];
$arrivalAirport = $row['arrival'];
$hours = $row['flightTime'];
$fuelUsed = $row['fuel'];
$aircraftUsed = $row['aircraft'];
$statusPirep = $row['status'];
$pilotComment = $row['comment'];

if (isset($_POST['submit'])) {
$flight = mysql_escape_string($_POST['flight']);
$dept = mysql_escape_string(strtoupper($_POST['dept']));
$arrival = mysql_escape_string(strtoupper($_POST['arrival']));
$flightTime = mysql_escape_string($_POST['flightTime']);
$fuel = mysql_escape_string($_POST['fuel']);
$aircraft = $_POST['aircraft'];
$status = $_POST['status'];
$comments = $_POST['comments'];

$sql2 = "UPDATE pireps SET flight='$flight', dept='$dept', arrival='$arrival', flightTime='$flightTime', fuel='$fuel', aircraft='$aircraft', status='$status', comments='$comment' WHERE id='$id'";

$result2 = mysql_query($sql2) or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error());;header("Location: logbook.php?pid=" . $pilotid);

} else {}

?>

<!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=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
	limitField.value = limitField.value.substring(0, limitNum);
} else {
	limitCount.value = limitNum - limitField.value.length;
}
}
</script>
<title>VAAdministration Center</title>
</head>

<body>
<!-- Begins Wrapper -->
<div id="wrapper">
	<!-- Begins Header -->
	<div id="header">
	<center>
	<img src="images/aadmin.jpg" />
	</center>
	</div>
	<!-- Ends header -->
			<!-- Begins Faux -->
			<div id="faux">
				<!-- Begins left column -->
				<div id="leftcolumn">
				<br />
				<?php include 'include/menu.php'; ?>
				</div>
				<!-- Ends left column -->
					<!-- Begins content -->
					<div id="content">
					<center>
					<!-- Begins page title -->
					<br />
					<font color="red" size="6"><b>Edit </font><font color="blue" size="6">PIREP</b></font>
					<br />
					<br />
					<br />
					<?php echo $errors; ?>
					<table border="0" cellpadding="4" cellspacing="4">
					<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
					<tr>
  <td><b>Flight Number: </b></td>
  <td><input type="text" size="8" value="<?php echo $flightNum; ?>" name="flight" maxlength="7"/></td>
  </tr>
  <tr>
  <td><b>Departure Airport (ICAO): </b></td>
  <td><input type="text" size="4" value="<?php echo $departure; ?>" name="dept" maxlength="4"/></td>
  </tr>
  <tr>
  <td><b>Arrival Airport (ICAO): </b></td>
  <td><input type="text" size="4" value="<?php echo $arrivalAirport; ?>" name="arrival" maxlength="4"/></td>
  </tr>
  <tr>
  <td><b>Flight Time</b></td>
  <td><input type="text" size="1" value="<?php echo $hours; ?>" name="flightTime" maxlength="4" /></td>
  </tr>
  <tr>
  <td><b>Fuel (lbs.): </b></td>
  <td><input type="text" size="10" value="<?php echo $fuelUsed; ?>" name="fuel" maxlength="6"/></td>
  </tr>
  <tr>
  <td><b>Aircraft: </b></td>
  <td><select name="aircraft">
  <option value="ATR-72" <?php if ($aircraftUsed == 'ATR-72') echo 'selected="selected"'; ?>>ATR-72</option>
  <option value="ERJ-135" <?php if ($aircraftUsed == 'ERJ-135') echo 'selected="selected"'; ?>>ERJ-135</option>
  <option value="ERJ-140" <?php if ($aircraftUsed == 'ERJ-140') echo 'selected="selected"'; ?>>ERJ-140</option>
  <option value="ERJ-145" <?php if ($aircraftUsed == 'ERJ-145') echo 'selected="selected"'; ?>>ERJ-145</option>
  <option value="CRJ-700" <?php if ($aircraftUsed == 'CRJ-700') echo 'selected="selected"'; ?>>CRJ-700</option>
  <option value="MD-80" <?php if ($aircraftUsed == 'MD-80') echo 'selected="selected"'; ?>>McDonnel Douglas MD-80</option>
  <option value="B737" <?php if ($aircraftUsed == 'B737') echo 'selected="selected"'; ?>>Boeing 737-800</option>
  <option value="B757" <?php if ($aircraftUsed == 'B757') echo 'selected="selected"'; ?>>Boeing 757</option>
  <option value="B767" <?php if ($aircraftUsed == 'B767') echo 'selected="selected"'; ?>>Boeing 767</option>
  <option value="B777" <?php if ($aircraftUsed == 'B777') echo 'selected="selected"'; ?>>Boeing 777</option>
  </select></td>
  </tr>
  <tr>
  <td><b>Status: </b></td>
  <td><select name="status">
  <option value="1" <?php if ($statusPirep == '1') echo 'selected="selected"'; ?>>Approved</option>
  <option value="2" <?php if ($statusPirep == '2') echo 'selected="selected"'; ?>>Declined</option></select></td>
  </tr>
  <tr>
  <td><b>Comments: </b>
  <td><textarea cols="20" rows="15" name="comments" onKeyDown="limitText(this.form.comments,this.form.countdown,350);"  onKeyUp="limitText(this.form.comments,this.form.countdown,350);"><?php echo $pilotComment; ?></textarea><br>
          You have <input readonly type="text" name="countdown" size="3" value="350"> characters left.</font></td>
  </td>
  </tr>
  <tr>
  <td></td>
  <td><input type="submit" value="Submit" name="submit" class="myButton"/></td>
  </tr>
  </table>
  </form>

					</center>
					<!-- DO NOT TOUCH -->
					<br />
					<!-- DONE -->
					</div>
				<!-- Begins right column -->
				<div id="rightcolumn">
				<br />
				</div>
				<!-- Ends right column -->
	<!-- Begins footer -->
	<div id="footer">
	<center>
	<?php include 'include/footer.php'; ?>
	</center>
	</div>
	<!-- Ends footer -->
			</div>
</div>
</body>
</html>

 

There ya go. Sorry to put you guys through so much trouble. Thanks all of you!

 

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252798
Share on other sites

Alright I wrote a debugging version of your code, let me know the outputs you see on the screen

 

<?php
session_start();

ini_set ("display_errors", "1");
error_reporting(E_ALL);
require 'include/sql.php';

$errors = "";

$adminid = $_SESSION['adminid'];
$adminpass = $_SESSION['adminpass'];
$position = $_SESSION['position'];

if(!isset($adminid) || !isset($adminpass) || !isset($position)) {
header("Location: index.php");
}



$id = $_GET['id'];

$sql = "SELECT * FROM pireps WHERE `id` = $id";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);

$pilotid = $row['pilotID'];
$flightNum = $row['flight'];
$departure = $row['dept'];
$arrivalAirport = $row['arrival'];
$hours = $row['flightTime'];
$fuelUsed = $row['fuel'];
$aircraftUsed = $row['aircraft'];
$statusPirep = $row['status'];
$pilotComment = $row['comment'];

print "THE VALUE OF PILOT ID IS: ". $pilotid;

if (isset($_POST['submit'])) {
$flight = mysql_escape_string($_POST['flight']);
$dept = mysql_escape_string(strtoupper($_POST['dept']));
$arrival = mysql_escape_string(strtoupper($_POST['arrival']));
$flightTime = mysql_escape_string($_POST['flightTime']);
$fuel = mysql_escape_string($_POST['fuel']);
$aircraft = $_POST['aircraft'];
$status = $_POST['status'];
$comments = $_POST['comments'];

$sql2 = "UPDATE pireps SET flight='$flight', dept='$dept', arrival='$arrival', flightTime='$flightTime', fuel='$fuel', aircraft='$aircraft', status='$status', comments='$comment' WHERE `id` = '$id' ";

$result2 = mysql_query($sql2) or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error());
print "THE VALUE OF PILOT ID IS: ". $pilotid;

#header("Location: logbook.php?pid=" . $pilotid);

} else {

print "Form was not submitted";

}

?>

<!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=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
	limitField.value = limitField.value.substring(0, limitNum);
} else {
	limitCount.value = limitNum - limitField.value.length;
}
}
</script>
<title>VAAdministration Center</title>
</head>

<body>
<!-- Begins Wrapper -->
<div id="wrapper">
	<!-- Begins Header -->
	<div id="header">
	<center>
	<img src="images/aadmin.jpg" />
	</center>
	</div>
	<!-- Ends header -->
			<!-- Begins Faux -->
			<div id="faux">
				<!-- Begins left column -->
				<div id="leftcolumn">
				<br />
				<?php include 'include/menu.php'; ?>
				</div>
				<!-- Ends left column -->
					<!-- Begins content -->
					<div id="content">
					<center>
					<!-- Begins page title -->
					<br />
					<font color="red" size="6"><b>Edit </font><font color="blue" size="6">PIREP</b></font>
					<br />
					<br />
					<br />
					<?php echo $errors; ?>
					<table border="0" cellpadding="4" cellspacing="4">
					<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
					<tr>
  <td><b>Flight Number: </b></td>
  <td><input type="text" size="8" value="<?php echo $flightNum; ?>" name="flight" maxlength="7"/></td>
  </tr>
  <tr>
  <td><b>Departure Airport (ICAO): </b></td>
  <td><input type="text" size="4" value="<?php echo $departure; ?>" name="dept" maxlength="4"/></td>
  </tr>
  <tr>
  <td><b>Arrival Airport (ICAO): </b></td>
  <td><input type="text" size="4" value="<?php echo $arrivalAirport; ?>" name="arrival" maxlength="4"/></td>
  </tr>
  <tr>
  <td><b>Flight Time</b></td>
  <td><input type="text" size="1" value="<?php echo $hours; ?>" name="flightTime" maxlength="4" /></td>
  </tr>
  <tr>
  <td><b>Fuel (lbs.): </b></td>
  <td><input type="text" size="10" value="<?php echo $fuelUsed; ?>" name="fuel" maxlength="6"/></td>
  </tr>
  <tr>
  <td><b>Aircraft: </b></td>
  <td><select name="aircraft">
  <option value="ATR-72" <?php if ($aircraftUsed == 'ATR-72') echo 'selected="selected"'; ?>>ATR-72</option>
  <option value="ERJ-135" <?php if ($aircraftUsed == 'ERJ-135') echo 'selected="selected"'; ?>>ERJ-135</option>
  <option value="ERJ-140" <?php if ($aircraftUsed == 'ERJ-140') echo 'selected="selected"'; ?>>ERJ-140</option>
  <option value="ERJ-145" <?php if ($aircraftUsed == 'ERJ-145') echo 'selected="selected"'; ?>>ERJ-145</option>
  <option value="CRJ-700" <?php if ($aircraftUsed == 'CRJ-700') echo 'selected="selected"'; ?>>CRJ-700</option>
  <option value="MD-80" <?php if ($aircraftUsed == 'MD-80') echo 'selected="selected"'; ?>>McDonnel Douglas MD-80</option>
  <option value="B737" <?php if ($aircraftUsed == 'B737') echo 'selected="selected"'; ?>>Boeing 737-800</option>
  <option value="B757" <?php if ($aircraftUsed == 'B757') echo 'selected="selected"'; ?>>Boeing 757</option>
  <option value="B767" <?php if ($aircraftUsed == 'B767') echo 'selected="selected"'; ?>>Boeing 767</option>
  <option value="B777" <?php if ($aircraftUsed == 'B777') echo 'selected="selected"'; ?>>Boeing 777</option>
  </select></td>
  </tr>
  <tr>
  <td><b>Status: </b></td>
  <td><select name="status">
  <option value="1" <?php if ($statusPirep == '1') echo 'selected="selected"'; ?>>Approved</option>
  <option value="2" <?php if ($statusPirep == '2') echo 'selected="selected"'; ?>>Declined</option></select></td>
  </tr>
  <tr>
  <td><b>Comments: </b>
  <td><textarea cols="20" rows="15" name="comments" onKeyDown="limitText(this.form.comments,this.form.countdown,350);"  onKeyUp="limitText(this.form.comments,this.form.countdown,350);"><?php echo $pilotComment; ?></textarea><br>
          You have <input readonly type="text" name="countdown" size="3" value="350"> characters left.</font></td>
  </td>
  </tr>
  <tr>
  <td></td>
  <td><input type="submit" value="Submit" name="submit" class="myButton"/></td>
  </tr>
  </table>
  </form>

					</center>
					<!-- DO NOT TOUCH -->
					<br />
					<!-- DONE -->
					</div>
				<!-- Begins right column -->
				<div id="rightcolumn">
				<br />
				</div>
				<!-- Ends right column -->
	<!-- Begins footer -->
	<div id="footer">
	<center>
	<?php include 'include/footer.php'; ?>
	</center>
	</div>
	<!-- Ends footer -->
			</div>
</div>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252802
Share on other sites

Here's the errors:

 

 

 

Notice: Undefined index: id in /home/virtuala/public_html/site/admin/editPirep.php on line 20

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/virtuala/public_html/site/admin/editPirep.php on line 24

THE VALUE OF PILOT ID IS:

Notice: Undefined variable: comment in /home/virtuala/public_html/site/admin/editPirep.php on line 48

THE VALUE OF PILOT ID IS:

 

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252818
Share on other sites

Alright, lets see what the cause of the mysql error is.

 

try this and let me know the ouput.

 

<?php
session_start();

ini_set ("display_errors", "1");
error_reporting(E_ALL ^ E_NOTICE);
require 'include/sql.php';

$errors = "";

$adminid = $_SESSION['adminid'];
$adminpass = $_SESSION['adminpass'];
$position = $_SESSION['position'];

if(!isset($adminid) || !isset($adminpass) || !isset($position)) {
header("Location: index.php");
}



$id = $_GET['id'];

$sql = "SELECT * FROM pireps WHERE `id` = $id";
$result = mysql_query($sql);
die(mysql_error());
$row = mysql_fetch_array($result);

$pilotid = $row['pilotID'];
$flightNum = $row['flight'];
$departure = $row['dept'];
$arrivalAirport = $row['arrival'];
$hours = $row['flightTime'];
$fuelUsed = $row['fuel'];
$aircraftUsed = $row['aircraft'];
$statusPirep = $row['status'];
$pilotComment = $row['comment'];

print "THE VALUE OF PILOT ID IS: ". $pilotid;

if (isset($_POST['submit'])) {
$flight = mysql_escape_string($_POST['flight']);
$dept = mysql_escape_string(strtoupper($_POST['dept']));
$arrival = mysql_escape_string(strtoupper($_POST['arrival']));
$flightTime = mysql_escape_string($_POST['flightTime']);
$fuel = mysql_escape_string($_POST['fuel']);
$aircraft = $_POST['aircraft'];
$status = $_POST['status'];
$comments = $_POST['comments'];

$sql2 = "UPDATE pireps SET flight='$flight', dept='$dept', arrival='$arrival', flightTime='$flightTime', fuel='$fuel', aircraft='$aircraft', status='$status', comments='$comment' WHERE `id` = '$id' ";

$result2 = mysql_query($sql2) or die("An error has occured. Please contact the webmaster with the following error: " . mysql_error());
print "THE VALUE OF PILOT ID IS: ". $pilotid;

#header("Location: logbook.php?pid=" . $pilotid);

} else {

print "Form was not submitted";

}

?>

<!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=iso-8859-1" />
<link rel="stylesheet" type="text/css" href="css/styles.css" />
<script language="javascript" type="text/javascript">
function limitText(limitField, limitCount, limitNum) {
if (limitField.value.length > limitNum) {
	limitField.value = limitField.value.substring(0, limitNum);
} else {
	limitCount.value = limitNum - limitField.value.length;
}
}
</script>
<title>VAAdministration Center</title>
</head>

<body>
<!-- Begins Wrapper -->
<div id="wrapper">
	<!-- Begins Header -->
	<div id="header">
	<center>
	<img src="images/aadmin.jpg" />
	</center>
	</div>
	<!-- Ends header -->
			<!-- Begins Faux -->
			<div id="faux">
				<!-- Begins left column -->
				<div id="leftcolumn">
				<br />
				<?php include 'include/menu.php'; ?>
				</div>
				<!-- Ends left column -->
					<!-- Begins content -->
					<div id="content">
					<center>
					<!-- Begins page title -->
					<br />
					<font color="red" size="6"><b>Edit </font><font color="blue" size="6">PIREP</b></font>
					<br />
					<br />
					<br />
					<?php echo $errors; ?>
					<table border="0" cellpadding="4" cellspacing="4">
					<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
					<tr>
  <td><b>Flight Number: </b></td>
  <td><input type="text" size="8" value="<?php echo $flightNum; ?>" name="flight" maxlength="7"/></td>
  </tr>
  <tr>
  <td><b>Departure Airport (ICAO): </b></td>
  <td><input type="text" size="4" value="<?php echo $departure; ?>" name="dept" maxlength="4"/></td>
  </tr>
  <tr>
  <td><b>Arrival Airport (ICAO): </b></td>
  <td><input type="text" size="4" value="<?php echo $arrivalAirport; ?>" name="arrival" maxlength="4"/></td>
  </tr>
  <tr>
  <td><b>Flight Time</b></td>
  <td><input type="text" size="1" value="<?php echo $hours; ?>" name="flightTime" maxlength="4" /></td>
  </tr>
  <tr>
  <td><b>Fuel (lbs.): </b></td>
  <td><input type="text" size="10" value="<?php echo $fuelUsed; ?>" name="fuel" maxlength="6"/></td>
  </tr>
  <tr>
  <td><b>Aircraft: </b></td>
  <td><select name="aircraft">
  <option value="ATR-72" <?php if ($aircraftUsed == 'ATR-72') echo 'selected="selected"'; ?>>ATR-72</option>
  <option value="ERJ-135" <?php if ($aircraftUsed == 'ERJ-135') echo 'selected="selected"'; ?>>ERJ-135</option>
  <option value="ERJ-140" <?php if ($aircraftUsed == 'ERJ-140') echo 'selected="selected"'; ?>>ERJ-140</option>
  <option value="ERJ-145" <?php if ($aircraftUsed == 'ERJ-145') echo 'selected="selected"'; ?>>ERJ-145</option>
  <option value="CRJ-700" <?php if ($aircraftUsed == 'CRJ-700') echo 'selected="selected"'; ?>>CRJ-700</option>
  <option value="MD-80" <?php if ($aircraftUsed == 'MD-80') echo 'selected="selected"'; ?>>McDonnel Douglas MD-80</option>
  <option value="B737" <?php if ($aircraftUsed == 'B737') echo 'selected="selected"'; ?>>Boeing 737-800</option>
  <option value="B757" <?php if ($aircraftUsed == 'B757') echo 'selected="selected"'; ?>>Boeing 757</option>
  <option value="B767" <?php if ($aircraftUsed == 'B767') echo 'selected="selected"'; ?>>Boeing 767</option>
  <option value="B777" <?php if ($aircraftUsed == 'B777') echo 'selected="selected"'; ?>>Boeing 777</option>
  </select></td>
  </tr>
  <tr>
  <td><b>Status: </b></td>
  <td><select name="status">
  <option value="1" <?php if ($statusPirep == '1') echo 'selected="selected"'; ?>>Approved</option>
  <option value="2" <?php if ($statusPirep == '2') echo 'selected="selected"'; ?>>Declined</option></select></td>
  </tr>
  <tr>
  <td><b>Comments: </b>
  <td><textarea cols="20" rows="15" name="comments" onKeyDown="limitText(this.form.comments,this.form.countdown,350);"  onKeyUp="limitText(this.form.comments,this.form.countdown,350);"><?php echo $pilotComment; ?></textarea><br>
          You have <input readonly type="text" name="countdown" size="3" value="350"> characters left.</font></td>
  </td>
  </tr>
  <tr>
  <td></td>
  <td><input type="submit" value="Submit" name="submit" class="myButton"/></td>
  </tr>
  </table>
  </form>

					</center>
					<!-- DO NOT TOUCH -->
					<br />
					<!-- DONE -->
					</div>
				<!-- Begins right column -->
				<div id="rightcolumn">
				<br />
				</div>
				<!-- Ends right column -->
	<!-- Begins footer -->
	<div id="footer">
	<center>
	<?php include 'include/footer.php'; ?>
	</center>
	</div>
	<!-- Ends footer -->
			</div>
</div>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/243959-header/#findComment-1252821
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.