Here is my search form:
-----------------------
<form method="post" action="search_results.php">
<input type="checkbox" name="us" value=http://www.phpbuilder.com/board/archive/index.php/"1"> University in Spain<br>
<input type="checkbox" name="slcp" value="1"> Spanish Language and Cultural Programs<br>
<input type="checkbox" name="saubp" value="1"> US Based Study Abroad Programs<br>
<input type="checkbox" name="sls" value="1"> Spanish Language Schools<br>
<input type="checkbox" name="pd" value="1"> Professional Development<br>
<input type="checkbox" name="iss" value="1"> International Secondary Schools<p>
<select name="metode" size="1">
<option value="name">Name</option>
<option value="address2">Location</option>
<option value="description">Description</option>
</select>
<input type="text" name="search" size="25">
<input type="submit" value="Go">
</form>
----------------------
I want to make it so people can select any or all of the checkboxes. Each checkbox is rferring to a field in the Database that has a value of 1. I need some kind of if/then statement? Here is what I have, can someone fil in the blanks?
------------------------
<?
//error message (not found message)
$XX = "No Record Found";
$query = mysql_query("SELECT * FROM pd WHERE $metode LIKE'%$search%' AND $us = '1' ORDER BY name");
while ($row = mysql_fetch_array($query))
{
$variable1=$row["name"];
$variable2=$row["address1"];
$variable3=$row["address2"];
$variable4=$row["tel"];
$variable5=$row["fax"];
$variable6=$row["url"];
$variable7=$row["email"];
$variable8=$row["description"];
printf("<b>%s</b><br>\n", $variable1 );
printf("%s<br>\n", $variable2 );
printf("%s<br>\n", $variable3 );
printf("Tel.: %s<br>\n", $variable4 );
printf("Fax.: %s<br>\n", $variable5 );
printf("%s<br>\n", $variable6 );
printf("<a href='http://www.phpbuilder.com/board/archive/index.php/mailto:%s?subject=student inquiry from SpainExchange.com'>Email this School</a><p>\n", $variable7 );
printf("%s<br>\n", $variable8 );
echo "<p>\n";
}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
?>
--------------------------
any help is great appreciated.
-----------------------
<form method="post" action="search_results.php">
<input type="checkbox" name="us" value=http://www.phpbuilder.com/board/archive/index.php/"1"> University in Spain<br>
<input type="checkbox" name="slcp" value="1"> Spanish Language and Cultural Programs<br>
<input type="checkbox" name="saubp" value="1"> US Based Study Abroad Programs<br>
<input type="checkbox" name="sls" value="1"> Spanish Language Schools<br>
<input type="checkbox" name="pd" value="1"> Professional Development<br>
<input type="checkbox" name="iss" value="1"> International Secondary Schools<p>
<select name="metode" size="1">
<option value="name">Name</option>
<option value="address2">Location</option>
<option value="description">Description</option>
</select>
<input type="text" name="search" size="25">
<input type="submit" value="Go">
</form>
----------------------
I want to make it so people can select any or all of the checkboxes. Each checkbox is rferring to a field in the Database that has a value of 1. I need some kind of if/then statement? Here is what I have, can someone fil in the blanks?
------------------------
<?
//error message (not found message)
$XX = "No Record Found";
$query = mysql_query("SELECT * FROM pd WHERE $metode LIKE'%$search%' AND $us = '1' ORDER BY name");
while ($row = mysql_fetch_array($query))
{
$variable1=$row["name"];
$variable2=$row["address1"];
$variable3=$row["address2"];
$variable4=$row["tel"];
$variable5=$row["fax"];
$variable6=$row["url"];
$variable7=$row["email"];
$variable8=$row["description"];
printf("<b>%s</b><br>\n", $variable1 );
printf("%s<br>\n", $variable2 );
printf("%s<br>\n", $variable3 );
printf("Tel.: %s<br>\n", $variable4 );
printf("Fax.: %s<br>\n", $variable5 );
printf("%s<br>\n", $variable6 );
printf("<a href='http://www.phpbuilder.com/board/archive/index.php/mailto:%s?subject=student inquiry from SpainExchange.com'>Email this School</a><p>\n", $variable7 );
printf("%s<br>\n", $variable8 );
echo "<p>\n";
}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
?>
--------------------------
any help is great appreciated.