scottyrob
04-09-2006, 12:44 PM
Hi folks.. I have these two pages
drop_down.php
<?
require 'db_connect.php';
$query = ("SELECT Attend FROM Permission_To_Camp");
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
?>
<form name='Form1' action='dropdown_results.php' method='post'>
<select name='Attend_Dropdown'>
<? while ($row = mysql_fetch_assoc($result)) { ?>
<option value="<? '.$row['Attend'].' ?>"><? '.$row['Attend'].' ?></option>
<? } ?>
<input type='submit' value='Submit'>\n";
</select>
</form>
<?
mysql_free_result($result);
?>
dropdown_results.php
<?
require 'db_connect.php';
$query = "SELECT * FROM Permission_To_Camp WHERE location = '".$_POST['Attend_Dropdown']."'";
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query:' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
while ($row = mysql_fetch_assoc($result)) {
echo $row['Attend'];
echo $row['Location'];
echo $row['Fromto'];
echo $row['Leadership'];
}
mysql_free_result($result);
?>
drop_down.php works fine, i can select and item from the menu, but when i submit the data to the next page, i cannot see anything on it, just a white page... Any ideas why?
drop_down.php
<?
require 'db_connect.php';
$query = ("SELECT Attend FROM Permission_To_Camp");
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
?>
<form name='Form1' action='dropdown_results.php' method='post'>
<select name='Attend_Dropdown'>
<? while ($row = mysql_fetch_assoc($result)) { ?>
<option value="<? '.$row['Attend'].' ?>"><? '.$row['Attend'].' ?></option>
<? } ?>
<input type='submit' value='Submit'>\n";
</select>
</form>
<?
mysql_free_result($result);
?>
dropdown_results.php
<?
require 'db_connect.php';
$query = "SELECT * FROM Permission_To_Camp WHERE location = '".$_POST['Attend_Dropdown']."'";
$result = mysql_query($query);
if (!$result) {
$message = 'Invalid query:' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
while ($row = mysql_fetch_assoc($result)) {
echo $row['Attend'];
echo $row['Location'];
echo $row['Fromto'];
echo $row['Leadership'];
}
mysql_free_result($result);
?>
drop_down.php works fine, i can select and item from the menu, but when i submit the data to the next page, i cannot see anything on it, just a white page... Any ideas why?