Forum Moderators: coopster
<?php
// Set error handling.
error_reporting(E_ERROR | E_WARNING | E_PARSE);
ini_set('track_errors', true);
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$clientIP = $_SERVER['REMOTE_ADDR'];
}
unset($aom, $aomx);
$zipSubmit = $_POST['Submit'];
if (isset($_POST['Submit'])){
$aom= array("0","0","0","0","0","0","0","0","0","0","0","0","0","0");
$aomx= $_POST['aom'];
$zipMilesHigh= $_POST['zipMilesHigh'];
$zip1= $_POST['zip1'];
if (!empty($aomx)){foreach ( $aomx as $id => $val) $aom[$id] = $val; }else{ $aom = array("1","0","0","0","0","0","0","0","0","0","0","0","0","0"); }
//foreach ( $aom as $id => $val) echo " aom[".$id."]=".$val;
echo "<br>** Submit set: ";
}else{
$aom = array("1","0","0","0","0","0","0","0","0","0","0","0","0","0");
$zipMilesHigh= "20";
$zip1= "48207";
echo "<br>** Submit not set: ";
}
echo $zipSubmit.", aom["; if (!empty($aom)){ foreach ($aom as $value) echo $value; }else{ echo "x000000000000x"; } echo "], miles: ".$zipMilesHigh.", zip1: ".$zip1;
echo "<br>** ";
var_dump($aom);
echo "<br>";
?>
<!-- html input form. -->
<html>
<body>
<table border="0" align="center" cellpadding="20" cellspacing="0" style="border:1px solid #FFB219;">
<td><b>Find charities offering selected Act of Mercy within selected miles of specified zip code</b></td>
</table>
<form action="" method="post">
<table border="1" align="center" cellpadding="10" cellspacing="0" style="border:1px solid #FFB219;">
<br><br>
<tr>
<td>Find all Charities with the selected Act(s) of Mercy<br>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[00] == "1") echo ' checked="checked"'; ?>/> Feed the hungry<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[01] == "1") echo ' checked="checked"'; ?>/> Give drink to the thirsty<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[02] == "1") echo ' checked="checked"'; ?>/> Clothe the naked<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[03] == "1") echo ' checked="checked"'; ?>/> Visit the and ransom the captive<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[04] == "1") echo ' checked="checked"'; ?>/> Shelter the homeless<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[05] == "1") echo ' checked="checked"'; ?>/> Visit the sick<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[06] == "1") echo ' checked="checked"'; ?>/> Bury the dead<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[07] == "1") echo ' checked="checked"'; ?>/> Instruct the ignorant<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[08] == "1") echo ' checked="checked"'; ?>/> Counsel the doubtful<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[09] == "1") echo ' checked="checked"'; ?>/> Admonish sinners<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[10] == "1") echo ' checked="checked"'; ?>/> Bear wrongs patiently<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[11] == "1") echo ' checked="checked"'; ?>/> Forgive offenses willingly<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[12] == "1") echo ' checked="checked"'; ?>/> Comfort the afflicted<br/>
<input name="aom[]" type="checkbox" value="1"<?php if ($aom[13] == "1") echo ' checked="checked"'; ?>/> Pray for the living and the dead<br/>
</td>
<td>within:
<select name="zipMilesHigh" id="zipMilesHigh">
<option value="05"<?php if ($zipMilesHigh == 05) echo ' selected="selected"'; ?>> 5 Miles</option>
<option value="10"<?php if ($zipMilesHigh == 10) echo ' selected="selected"'; ?>>10 Miles</option>
<option value="15"<?php if ($zipMilesHigh == 15) echo ' selected="selected"'; ?>>15 Miles</option>
<option value="20"<?php if ($zipMilesHigh == 20) echo ' selected="selected"'; ?>>20 Miles</option>
<option value="25"<?php if ($zipMilesHigh == 25) echo ' selected="selected"'; ?>>25 Miles</option>
<option value="30"<?php if ($zipMilesHigh == 30) echo ' selected="selected"'; ?>>30 Miles</option>
<option value="35"<?php if ($zipMilesHigh == 35) echo ' selected="selected"'; ?>>35 Miles</option>
<option value="40"<?php if ($zipMilesHigh == 40) echo ' selected="selected"'; ?>>40 Miles</option>
<option value="45"<?php if ($zipMilesHigh == 45) echo ' selected="selected"'; ?>>45 Miles</option>
<option value="50"<?php if ($zipMilesHigh == 50) echo ' selected="selected"'; ?>>50 Miles</option>
</select> of ZIP Code: <input name="zip1" type="text" size="10" maxlength="10" value=<?php echo '"'.$zip1.'"'; ?> onfocus='if(this.value==<?php echo '"'.$zip1.'"'; ?>)this.value=""'/>
</td>
<td><input type="submit" name="Submit" value="Submit"> </td>
</tr>
</table>
</form>
</body>
</html>
<?php
echo $zipSubmit.", aom["; if (!empty($aom)){ foreach ($aom as $value) echo $value; }else{ echo "x000000000000x"; } echo "], miles: ".$zipMilesHigh.", zip1: ".$zip1;
echo "<br>** ";
var_dump($aom);
echo "<br>";
?>