Hi everyone...
I need some help......I have drop down menu's on my php page..These contain lists of food..What i want to happen is when some one clicks on one of these food's the price to appear beside the drop down menu....I was told to use jscript to refresh the page but the problem is these menu's won't appear on the screen until a condition is met...I can't seem to pass the conditions when the page refreshes....Here is the code...Any help would be great....
if (login($username, $passwd))
{
do_html_header();
echo "<div class='center'>";
echo "<form action='finalorder.php' method='post'>";
echo "<table width='100%'>";
/***************************************************/
echo "<tr class='center'><td>";
$conn = odbc_connect('Canteen' , '', '') or die("<h1>Error1</h1>");
if (!$conn)
return 0;
$strSQL = " select Breakfast from price";
//echo $strSQL."<br><br>";
$cur= odbc_exec( $conn, $strSQL);
if (!$cur)
{
exit("Error in query");
}
echo "<select name='Breakfast'
onChange=\"window.location='../Niall/order.php'\">";
while (odbc_fetch_row($cur)){
$val =odbc_result($cur, 'Breakfast');
print "<option value=\"$val\">$val";
}
echo "</select>";
odbc_free_result($cur);
odbc_close($conn);
echo "</td></tr></table>";
/****************************************************/
echo "<input type='hidden' name='username' value='";
echo $username;
echo "'>";
echo "<input type='hidden' name='passwd' value='";
echo $passwd;
echo "'>";
}
else
{
// unsuccessful login
do_html_header("Problem:");
echo "You could not be logged in.
You must be logged in to view this page.";
}
Thank You
Niall