ok i have a page that i use to edit a record
problem being one oh the fields in the form is a selection box/ drop down box but when i load the page to edit the record i have to click on the Frame Type again.
my question is: How can i get it to automaticaly SELECT the Frame Type?
Selection1.php (creates the selections)
<?php
include "config.php3";
$query = mysql_query("SELECT * FROM $table2") or die(mysql_error());
while($row = mysql_fetch_array($query)){
$type1 = $row['type'];
$type .= "<option>$type1</option>";
}
echo "<select size='8' name='frametype'>";
echo $type;
echo "</select>";
?>
editframe.php (edits the frames)
<?php
session_start();
$acid = $_REQUEST['acid'];
include "config.php3";
if($_SESSION['loggedin'] == TRUE)
{
if($icaocode == 'new')
{
echo "Welcome To The Aircraft Editor";
print("
<form method='post' action='newframe.php3'>
Frame Number:
<input ype='text' value='' name='frame'>
<br><br>
Select Frame Type:
<br>");
include 'selection1.php3';
print("
<br><br>
Frame Hours:
<input ype='text' value='' name='framehours'>
<br><br>
Frame Location:
<input ype='text' value='' name='framelocation'>
<br><br>
<input type='submit' name='update' value='Create It'>
");
}
else
{
$query = mysql_query("SELECT * FROM $table WHERE id='$acid'");
while($row = mysql_fetch_array($query))
{
$frametype = $row['aircrafttype'];
$frame = $row['frame'];
$hours = $row['hours'];
$location = $row['location'];
}
echo "You Are Editing Frame: <b>$frame / $frametype</b>";
print("
<form method='post' action='updateframe.php3?acid=$acid&acframe=$frame'>
Frame Number:
<input ype='text' value='$frame' name='frame'>
<br><br>
Select Frame Type:
<br>");
include 'selection1.php3';
print("
<br><br>
Frame Hours:
<input ype='text' value='$hours' name='framehours'>
<br><br>
Frame Location:
<input ype='text' value='$location' name='framelocation'>
<br><br>
Delete Aircraft?:
<br>
<input Type='checkbox' name='delete'>
<br><br>
<input type='submit' name='update' value='Amend It'>
");
}
}
else
{
echo "<font color='red'><b>You Are Not Authorized To View This Page Please Go Back Or Login Below</font>";
include "login.htm";
}
?>
any help would be a great help 😃