what i have here is a catalog of a list of planes. when the user clicks on the 'order' link i want the AircraftName, Stock and scale variables to be sent over to the next page for that plane.
i have searched and searched and i still cant figure my problem out. i did mange to get it passing when they were in a textbox but not how it is at the moment.
is passing them in the URL the best option?
thanx for your help will be eagerly waiting to see how it is done!
Code: Select all
<html>
<body>
<?php
$db = mysql_pconnect('*****, '*****', '*****') or die ("Could not connect to database");
if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
mysql_select_db('models') or die ("Could not select database!");
$query = "select * from planes where P_Cat = 'WWII Fighters'";
$result = mysql_query($query) or die (mysql_error()."<br />Couldn't execute query: $query");
$num_results = mysql_num_rows($result);
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result);
$P_Stock = $rowї'P_Stock'];
$P_Name = $rowї'P_Name'];
$P_Cat = $rowї'P_Cat'];
$P_Scale = $rowї'P_Scale'];
echo" <table width='520' border='1'> ";
echo" <tr> ";
echo" <td width='80' height='15'>Aircraft:</td> ";
echo" <td colspan='5' > $P_Name </font></td> ";
echo" </tr> ";
echo" <tr> ";
echo" <td height='15'>Stock#:</td> ";
echo" <td colspan='5'> $P_Stock </font></td> ";
echo" </tr> ";
echo" <tr> ";
echo" <td height='15'>Scale:</td> ";
echo" <td colspan='5'> $P_Scale </font></td> ";
echo" </tr> ";
echo" <tr> ";
echo" <td height='15'></td> ";
echo" <td colspan='5'> <a href='order.php'> Order </a> </td> ";
echo" </tr> ";
echo" </table> ";
}
?>
</body>
</html>