Jump to content

[SOLVED] Anyone see where Im getting this error?


dewey_witt

Recommended Posts

ok I am getting this error

Warning: Invalid argument supplied for foreach()

 

here is the form. I don't see why Im getting this : /

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Some Form</title>
</head>
<body>
<h1>
<center>
	Please Enter The property's Info To Post To EzSell.<br>
	<?
	if(isset($_POST['submit'])) {
	session_start();
	}



// Checking if the post array is even set will make a HUGE difference in speed.
if(isset($_POST) && is_array($_POST)) {
foreach($_POST['Arch'] as $key => $val) {
	$arch .= "[" . $val . "]";
}
foreach($_POST['Const'] as $key => $val) {
	$const .= "[" . $val . "]";
}
foreach($_POST['Windows'] as $key => $val) {
	$windows .= "[" . $val . "]";
}
foreach($_POST['Heat'] as $key => $val) {
	$heat .= "[" . $val . "]";
}
foreach($_POST['Cooling'] as $key => $val) {
	$cooling .= "[" . $val . "]";
}
foreach($_POST['Parking'] as $key => $val) {
	$park .= "[" . $val . "]";
}
foreach($_POST as $k => $v) { $_POST[$k] = stripslashes($v); }
}
echo "$arch";
// Check if the variables are set, if not, then show the form
$checker = new PAGE_CHECKER;
if(!$checker->check_post_variables()) {
?>
</center>
</h1>
<form method="post" enctype="multipart/form-data" onSubmit="return checkCheckBox(this)">
<center>
	<table width="87%" border="1" cellspacing="0" cellpadding="0" bordercolor="#FF0000">
		<tr>
			<td>Street: </td>
			<td><input name="StrAddy" type="text" size="45" maxlength="45" /></td>
			<td>City: </td>
			<td><input name="City" type="text" size="45" maxlength="45" /></td>
		</tr>
		<tr>
			<td>County: </td>
			<td><input name="County" type="text" size="45" maxlength="45" /></td>
			<td>State: </td>
			<td><select style="WIDTH: 160px"
      name="State">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="AL"> Alabama </option>
					<option value="AK"> Alaska </option>
					<option value="AZ"> Arizona </option>
					<option value="AR"> Arkansas </option>
					<option value="CA"> California </option>
					<option value="CO"> Colorado </option>
					<option value="CT"> Connecticut </option>
					<option value="DE"> Delaware </option>
					<option value="DC"> District of Columbia </option>
					<option value="FL"> Florida </option>
					<option value="GA"> Georgia </option>
					<option value="HI"> Hawaii </option>
					<option value="ID"> Idaho </option>
					<option value="IL"> Illinois </option>
					<option value="IN"> Indiana </option>
					<option value="IA"> Iowa </option>
					<option value="KS"> Kansas </option>
					<option value="KY"> Kentucky </option>
					<option value="LA"> Louisiana </option>
					<option value="ME"> Maine </option>
					<option value="MD"> Maryland </option>
					<option value="MA"> Massachusetts </option>
					<option value="MI"> Michigan </option>
					<option value="MN"> Minnesota </option>
					<option value="MS"> Mississippi </option>
					<option value="MO"> Missouri </option>
					<option value="MT"> Montana </option>
					<option value="NE"> Nebraska </option>
					<option value="NV"> Nevada </option>
					<option value="NH"> New Hampshire </option>
					<option value="NJ"> New Jersey </option>
					<option value="NM"> New Mexico </option>
					<option value="NY"> New York </option>
					<option value="NC"> North Carolina </option>
					<option value="ND"> North Dakota </option>
					<option value="OH"> Ohio </option>
					<option value="OK"> Oklahoma </option>
					<option value="OR"> Oregon </option>
					<option value="PA"> Pennsylvania </option>
					<option value="RI"> Rhode Island </option>
					<option value="SC"> South Carolina </option>
					<option value="SD"> South Dakota </option>
					<option value="TN"> Tennessee </option>
					<option value="TX"> Texas </option>
					<option value="UT"> Utah </option>
					<option value="VT"> Vermont </option>
					<option value="VA"> Virginia </option>
					<option value="WA"> Washington </option>
					<option value="WV"> West Virginia </option>
					<option value="WI"> Wisconsin </option>
					<option value="WY"> Wyoming </option>
				</select></td>
		</tr>
		<tr>
			<td>Suburb: </td>
			<td><input name="Suburb" type="text" size="45" maxlength="45" /></td>
			<td>Sub Div: </td>
			<td><input name="SubDiv" type="text" size="45" maxlength="45" /></td>
		</tr>
		<tr>
			<td>List Price</td>
			<td><input name="Lst_Price" type="text" size="15" maxlength="15" value="$" /></td>
			<td>Room Total: </td>
			<td><input name="Total_Rooms" type="text" size="5" maxlength="5"  /></td>
		</tr>
		<tr>
			<td colspan="4"><center>
					<h1>Details</h1>
				</center></td>
		</tr>
		<tr>
			<td>Bedrooms: </td>
			<td><select size="1" name="Bedrooms">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="1"> 1 </option>
					<option value="2"> 2 </option>
					<option value="3"> 3 </option>
					<option value="4"> 4 </option>
					<option value="5"> 5 </option>
					<option value="5+"> 5+ </option>
				</select>
			</td>
			<td>Bathrooms: </td>
			<td><select size="1" name="Baths">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="1"> 1 </option>
					<option value="2"> 2 </option>
					<option value="3"> 3 </option>
					<option value="4"> 4 </option>
					<option value="5"> 5 </option>
					<option value="5+"> 5+ </option>
				</select></td>
		</tr>
		<tr>
			<td>Family Room: </td>
			<td><select size="1" name="FamilyRoom">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Y"> Yes </option>
					<option value="N"> No </option>
				</select></td>
			<td>Formal Dining: </td>
			<td><select size="1" name="FormalDining">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Y"> Yes </option>
					<option value="N"> No </option>
				</select></td>
		</tr>
		<tr>
			<td>First Floor Bedroom: </td>
			<td><select size="1" name="First_Bedroom">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Y"> Yes </option>
					<option value="N"> No </option>
				</select>
			</td>
			<td>First Floor Bathroom: </td>
			<td><select size="1" name="First_Bath">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Y"> Yes </option>
					<option value="N"> No </option>
				</select></td>
		</tr>
		<tr>
			<td>Unit Type: </td>
			<td><select size="1" name="Type">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Single Family"> Single Family </option>
					<option value="Duplex"> Duplex </option>
					<option value="Small Apartments"> Small Apartments </option>
					<option value="Large Apartments"> Large Apartments </option>
					<option value="Other"> Other </option>
				</select></td>
			<td>Levels: </td>
			<td><select size="1" name="Levels">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="1"> 1 </option>
					<option value="2"> 2 </option>
					<option value="3+"> 3+ </option>
				</select></td>
		</tr>
		<tr>
			<td>Arcatecture Type: </td>
			<td><table width="100%" border="1" cellspacing="0" cellpadding="0">
					<tr>
						<td><input name="Arch[]" type="checkbox" value="Traditional">
							Traditional</td>
						<td><input name="Arch[]" type="checkbox" value="Victorian">
							Victorian</td>
						<td><input name="Arch[]" type="checkbox" value="Ranch">
							Ranch</td>
					</tr>
					<tr>
						<td><input name="Arch[]" type="checkbox" value="Cottage">
							Cottage</td>
						<td><input name="Arch[]" type="checkbox" value="Transistional">
							Transistinal</td>
						<td><input name="Arch[]" type="checkbox" value="Log">
							Log</td>
					</tr>
					<tr>
						<td><input name="Arch[]" type="checkbox" value="Cape Cod">
							Cape Cod</td>
						<td><input name="Arch[]" type="checkbox" value="Dutch">
							Dutch</td>
						<td><input name="Arch[]" type="checkbox" value="Contemporary">
							Contemporary</td>
					</tr>
					<tr>
						<td><input name="Arch[]" type="checkbox" value="Salt Box">
							Salt Box</td>
						<td><input name="Arch[]" type="checkbox" value="Historical">
							Historical</td>
						<td><input name="Arch[]" type="checkbox" value="Chalet">
							Chalet</td>
					</tr>
					<tr>
						<td><input name="Arch[]" type="checkbox" value="Colonial">
							Colonial</td>
						<td><input name="Arch[]" type="checkbox" value="Spanish">
							Spanish</td>
						<td><input name="Arch[]" type="checkbox" value="Tudor">
							Tudor</td>
					</tr>
					<tr>
						<td colspan="3"><center>
								<input name="Other" type="checkbox" value="Other">
								Other
							</center></td>
					</tr>
				</table></td>
			<td>Construction: </td>
			<td><table width="99%" border="1" cellspacing="0" cellpadding="0">
					<tr>
						<td><input name="Const[]" type="checkbox" value="Brick">
							Brick</td>
						<td><input name="Const[]" type="checkbox" value="Stucco">
							Stucco</td>
						<td><input name="Const[]" type="checkbox" value="Vinyl">
							Vinyl</td>
					</tr>
					<tr>
						<td><input name="Const[]" type="checkbox" value="Shingle">
							Shingle</td>
						<td><input name="Const[]" type="checkbox" value="Wood">
							Wood</td>
						<td><input name="Const[]" type="checkbox" value="Block">
							Block</td>
					</tr>
					<tr>
						<td><input name="Const[]" type="checkbox" value="Alluminum">
							Alluminum</td>
						<td><input name="Const[]" type="checkbox" value="Log">
							Log</td>
						<td><input name="Const[]" type="checkbox" value="Stone">
							Stone</td>
					</tr>
					<tr>
						<td><input name="Const[]" type="checkbox" value="Cedar">
							Cedar</td>
						<td><input name="Const[]" type="checkbox" value="Other">
							Other</td>
						<td><input name="Const[]" type="checkbox" value="EFIS"></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td>Foundation: </td>
			<td><select size="1" name="Found">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Poured"> Poured </option>
					<option value="Slab"> Slab </option>
					<option value="Block"> Block </option>
					<option value="Stone"> Stone </option>
					<option value="Other"> Other </option>
				</select></td>
			<td>Roof: </td>
			<td><select size="1" name="Roof">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Shingle"> Shingle </option>
					<option value="Slate"> Slate </option>
					<option value="Rubber"> Rubber </option>
					<option value="Tile"> Tile </option>
					<option value="Other"> Other </option>
				</select></td>
		</tr>
		<tr>
			<td>Windows: </td>
			<td><table width="100%" border="1" cellspacing="0" cellpadding="0">
					<tr>
						<td><input name="WIndows[]" type="checkbox" value="Insulated">
							Insulated</td>
						<td><input name="Windows[]" type="checkbox" value="Bay\Bow">
							Bay\Bow</td>
						<td><input name="Windows[]" type="checkbox" value="Vinyl">
							Vinyl</td>
					</tr>
					<tr>
						<td><input name="Windows[]" type="checkbox" value="Slider">
							Slider</td>
						<td><input name="Windows[]" type="checkbox" value="Wood">
							Wood</td>
						<td><input name="Windows[]" type="checkbox" value="Picture">
							Picture</td>
					</tr>
					<tr>
						<td><input name="Windows[]" type="checkbox" value="Alluminum">
							Alluminum</td>
						<td><input name="Windows[]" type="checkbox" value="Awning">
							Awning</td>
						<td><input name="Windows[]" type="checkbox" value="Double Hung">
							Dbl Hung</td>
					</tr>
					<tr>
						<td><input name="Windows[]" type="checkbox" value="Garden">
							Garden</td>
						<td><input name="Windows[]" type="checkbox" value="Storm">
							Storm</td>
						<td><input name="Windows[]" type="checkbox" value="Vinyl\Alum Clad">
							Vinyl\Alum Clad</td>
					</tr>
					<tr>
						<td><input name="Windows[]" type="checkbox" value="Casement">
							Casement</td>
						<td><input name="Windows[]" type="checkbox" value="Other">
							Other</td>
						<td> </td>
					</tr>
				</table></td>
			<td>Heating: </td>
			<td><table width="100%" border="1" cellspacing="0" cellpadding="0">
					<tr>
						<td><input name="Heat[]" type="checkbox" value="Gas">
							Gas</td>
						<td><input name="Heat[]" type="checkbox" value="Electric">
							Electric</td>
						<td><input name="Heat[]" type="checkbox" value="Oil">
							Oil</td>
					</tr>
					<tr>
						<td><input name="Heat[]" type="checkbox" value="Hot Water">
							Hot Water</td>
						<td><input name="Heat[]" type="checkbox" value="Wood">
							Wood</td>
						<td><input name="Heat[]" type="checkbox" value="Steam">
							Steam</td>
					</tr>
					<tr>
						<td><input name="Heat[]" type="checkbox" value="Solar" />
							Solar</td>
						<td><input name="Heat[]" type="checkbox" value="Coal">
							Coal</td>
						<td><input name="Heat[]" type="checkbox" value="Forced Air">
							Forced Air</td>
					</tr>
					<tr>
						<td><input name="Heat[]" type="checkbox" value="Heat Pump">
							Heat Pump</td>
						<td><input name="Heat[]" type="checkbox" value="Baseboard">
							Baseboard</td>
						<td><input name="Heat[]" type="checkbox" value="Radiant">
							Radiant</td>
					</tr>
					<tr>
						<td><input name="Heat[]" type="checkbox" value="Gravity">
							Gravity</td>
						<td><input name="Heat[]" type="checkbox" value="Geothermal">
							Geothermal</td>
						<td><input name="Heat[]" type="checkbox" value="None">
							None</td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td>Age: </td>
			<td><select size="1" name="Age">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="5-10 Years "> 5-10 Years </option>
					<option value="11-20 Years "> 11-20 Years </option>
					<option value="21-30 Years "> 21-30 Years </option>
					<option value="31-40 Years "> 31-40 Years </option>
					<option value="41-50 Years "> 41-50 Years </option>
					<option value="51-60 Years "> 51-60 Years </option>
					<option value="61-70 Years "> 61-70 Years </option>
					<option value="71-80 Years "> 71-80 Years </option>
					<option value="81-90 Years "> 81-90 Years </option>
					<option value="91-100 Years "> 91-100 Years </option>
					<option value="100+ Years "> 100+ Years </option>
				</select></td>
			<td>Lot</td>
			<td><select size="1" name="Lot">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Irregula"> Irregular </option>
					<option value="Wooded"> Wooded </option>
					<option value="River View"> River View </option>
					<option value="City View"> City View </option>
					<option value="Corner Lot"> Corner Lot </option>
					<option value="Vacant"> Vacant </option>
					<option value="Other"> Other </option>
				</select></td>
		</tr>
		<tr>
			<td>Acherage: </td>
			<td><select size="1" name="Acreage">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Less Than 1"> Less Than 1 </option>
					<option value="1"> 1 </option>
					<option value="1.5"> 1.5 </option>
					<option value="2 "> 2 </option>
					<option value="2.5"> 2.5 </option>
					<option value="3"> 3 </option>
					<option value="3.5"> 3.5 </option>
					<option value="4"> 4 </option>
					<option value="4.5"> 4.5 </option>
					<option value="5"> 5 </option>
					<option value="5.5"> 5.5 </option>
					<option value="6"> 6 </option>
					<option value="7"> 7 </option>
					<option value="8"> 8 </option>
					<option value="9"> 9 </option>
					<option value="10"> 10 </option>
					<option value="10+"> 10+ </option>
				</select></td>
			<td>Basement: </td>
			<td><select size="1" name="Basement">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Full Unfinished"> Full Unfinished </option>
					<option value="Full Finished "> Full Finished </option>
					<option value="Partial Unfinished"> Partial Unfinished </option>
					<option value="Partial Finished"> Partial Finished </option>
					<option value="Cellar"> Cellar </option>
					<option value="Crawlspac"> Crawlspace </option>
					<option value="Other"> Other </option>
				</select></td>
		</tr>
		<tr>
			<td>Garage: </td>
			<td><select size="1" name="Garage">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Detached"> Detached </option>
					<option value="Attached"> Attached </option>
					<option value="Built In"> Built In </option>
					<option value="Other"> Other </option>
				</select></td>
			<td>FirePlace: </td>
			<td><select size="1" name="Fireplace">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Wood"> Wood </option>
					<option value="Gas"> Gas </option>
					<option value="Multi-Wood"> Multi-Wood </option>
					<option value="Multi-Gas"> Multi-Gas </option>
					<option value="Nonop"> Nonop</option>
					<option value="None"> None </option>
				</select></td>
		</tr>
		<tr>
			<td>Cooling: </td>
			<td><table width="99%" border="1" cellspacing="0" cellpadding="0">
					<tr>
						<td><input name="Cooling[]" type="checkbox" value="Central Air">
							Central Air</td>
						<td><input name="Cooling[]" type="checkbox" value="Window Unit">
							Window Unit</td>
					</tr>
					<tr>
						<td><input name="Cooling[]" type="checkbox" value="Attic Fan">
							Attic Fan</td>
						<td><input name="Cooling[]" type="checkbox" value="Wall Unit">
							Wall Unit</td>
					</tr>
					<tr>
						<td><input name="Cooling[]" type="checkbox" value="Other">
							Other</td>
						<td><input name="Cooling[]" type="checkbox" value="None">
							None</td>
					</tr>
				</table></td>
			<td>Parking: </td>
			<td><table width="99%" border="1" cellspacing="0" cellpadding="0">
					<tr>
						<td><input name="Parking[]" type="checkbox" value="Driveway">
							Driveway</td>
						<td><input name="Parking[]" type="checkbox" value="On Street">
							On Street</td>
					</tr>
					<tr>
						<td><input name="Parking[]" type="checkbox" value="Off Street">
							Off Street</td>
						<td><input name="Parking[]" type="checkbox" value="Asigned">
							Asigned</td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td>Gas</td>
			<td><select size="1" name="Gas">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Natural"> Natural </option>
					<option value="Oil"> Oil </option>
					<option value="Other"> Other </option>
				</select></td>
			<td>Water</td>
			<td><select size="1" name="Water">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Public "> Public </option>
					<option value="Well"> Well </option>
					<option value="Systern"> Systern </option>
				</select></td>
		</tr>
		<tr>
			<td>Sewage</td>
			<td><select size="1" name="Sewer">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Public"> Public </option>
					<option value="Septic System"> Septic System </option>
					<option value="Other"> Other </option>
				</select></td>
			<td> </td>
			<td> </td>
		</tr>
		<tr>
			<td colspan="4"><h1>
					<center>
						Propery Attributes
					</center>
				</h1></td>
		</tr>
		<tr>
			<td>Zoning: </td>
			<td><select size="1" name="Zoning">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Residential"> Residential </option>
					<option value="Commercial"> Commercial </option>
					<option value="Industral"> Industral </option>
					<option value="Agricultural"> Agricultural </option>
				</select>
				;</td>
			<td>Sa-Tax</td>
			<td><input name="SaTax" type="text" value="$" size="15" maxlength="15" /></td>
		</tr>
		<tr>
			<td>Tax Rate</td>
			<td><input name="TaxRate" type="text" size="20" maxlength="15" /></td>
			<td>Asmnt: </td>
			<td><input name="Asmnt" type="text" size="20" maxlength="50" /></td>
		</tr>
		<tr>
			<td>Occupy: </td>
			<td><select size="1" name="Occupy">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="On Closing"> On Closing </option>
					<option value="Specified Time After Closing"> Specified Time </option>
					<option value="Rental Property"> Rental Property </option>
					<option value="Other"> Other </option>
				</select></td>
			<td>Transportation: </td>
			<td><select size="1" name="Transp">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Public"> Public </option>
					<option value="Service"> Service </option>
					<option value="None"> None </option>
					<option value="Other"> Other </option>
				</select></td>
		</tr>
		<tr>
			<td>Condo Level: </td>
			<td><select size="1" name="LvlCondo">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="1"> 1 </option>
					<option value="2"> 2 </option>
					<option value="3"> 3</option>
					<option value="4"> 4 </option>
					<option value="5+"> 5+ </option>
				</select></td>
			<td>HOA Fee:</td>
			<td><input name="HOA" type="text" value="$" size="20" maxlength="15" /></td>
		</tr>
		<tr>
			<td>School District: </td>
			<td><input name="SchoolDis" type="text" size="20" maxlength="15" /></td>
			<td>School Phone: </td>
			<td><input name="SchoolPhone" type="text" size="20" maxlength="15" /></td>
		</tr>
		<tr>
			<td>Open House: </td>
			<td><input name="OhDate" type="text" size="20" maxlength="15" value="10/10/2000" onfocus="this.value=''" /></td>
			<td>Open House Time: </td>
			<td><input name="OhTime" type="text" value="12:00am" size="20" maxlength="10" onfocus="this.value=''" /></td>
		</tr>
		<tr>
			<td>Auction: </td>
			<td><select size="1" name="Auction">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Y"> Yes </option>
					<option value="N"> No </option>
				</select></td>
			<td>Special Financing: </td>
			<td><select size="1" name="SpecFin">
					<option value="None Selected" selected="selected"> Please Select </option>
					<option value="Y"> Yes </option>
					<option value="N"> No </option>
				</select></td>
		</tr>
		<tr>
			<td>Home Tax ID: </td>
			<td><input name="TaxID" type="text" size="20" maxlength="25" /></td>
			<td> </td>
			<td> </td>
		</tr>
		<tr>
			<td colspan="4"><center>
					Comments<br>
					<textarea name="Comments" cols="69" rows="13"></textarea>
				</center></td>
		</tr>
		<tr>
			<td colspan="2"><center>
					Please Select A Picture to Upload For Property:
				</center></td>
			<td colspan="2"><input type="file" name="upload" /></td>
		</tr>
		<tr>
			<td colspan="4"><h1>
					<center>
						Contact Information
					</center>
				</h1></td>
		</tr>
		<tr>
			<td>Full Name: </td>
			<td><input name="FullName" type="text" size="50" maxlength="50" /></td>
			<td>Organization: </td>
			<td><input name="ListerComp" type="text" size="50" maxlength="50" /></td>
		</tr>
		<tr>
			<td>Contact Address: </td>
			<td><input name="CompAddy" type="text" size="50" maxlength="50" /></td>
			<td>Contact City: </td>
			<td><input name="CompCity" type="text" size="35" maxlength="50" /></td>
		</tr>
		<tr>
			<td>Contact State: </td>
			<td><input name="CompState" type="text" size="35" maxlength="50" /></td>
			<td>Contact Zip: </td>
			<td><input name="CompZip" type="text" size="10" maxlength="10" /></td>
		</tr>
		<tr>
		<tr>
			<td>Primary Phone: </td>
			<td><input name="PrimPhone" type="text" size="20" maxlength="20" /></td>
			<td>Office Phone: </td>
			<td><input name="OfficePhone" type="text" size="20" maxlength="20" /></td>
		</tr>
		<tr>
			<td>Primary Fax: </td>
			<td><input name="PrimFax" type="text" size="20" maxlength="20" /></td>
			<td>Cell Number: </td>
			<td><input name="Cell" type="text" size="20" maxlength="20" /></td>
		</tr>
		<tr>
			<td>E-Mail</td>
			<td><input name="ListerEmail" type="text" size="40" maxlength="40" /></td>
			<td> </td>
			<td> </td>
		</tr>
		<td colspan="4"><center>
					<input type="submit" name="submit" value="Post Listing" />
					     
					<input name="reset" type="reset" value="Clear Form" />
				</center></td>
		</tr>
	</table>
</center>
</form>
<?
exit;
}

if(isset($_POST))  {
$upload_dir="images";
if(!dir($upload_dir)) { mkdir($upload_dir); }
$upload_loc = $upload_dir."/".basename($_FILES['upload']['name']);
if(file_exists($upload_loc)) {
	echo "File ('".basename($_FILES['upload']['name'])."') already exists, upload failed.\r\n";
	unlink($_FILES['upload']['tmp_name']);
} else {
	if(file_exists($_FILES['upload']['tmp_name'])) {
		if(!ereg("image\/.*", $_FILES['upload']['type'])) {
			echo "Invalid file type on ".basename($_FILES['upload']['name'])."\r\n";
			unlink($_FILES['upload']['tmp_name']);
		} else {
			if(move_uploaded_file($_FILES['upload']['tmp_name'], $upload_loc)) {
				echo "File uploaded successfully.<br /><br /><a href=\"".$upload_loc."\">Link</a><br /><a href=\"Buyers.php\">Back To Ezsell Home</a>\r\n";
			} else {
				echo "Failed to upload file ".basename($_FILES['upload']['name'])."\r\n";
			}
			unlink($_FILES['upload']['tmp_name']);
		}
	} else { echo "File didn't upload to server.\r\n"; }
}



$db_name="some_db";
$table_name="Post";
@mysql_connect("some_server", "somedb_user", "somedb_pass") or die(mysql_error());
// removed next line to save on processing time
//mysql_select_db($db_name, $connection) or die(mysql_error());
@mysql_query("
	INSERT INTO `".$db_name."`.`".$table_name."` (
		StrAddy, 
		City, 
		County, 
		State, 
		Suburb, 
		SubDiv, 
		Lst_Price, 
		Total_Rooms, 
		Bedrooms, 
		Baths, 
		FamilyRoom, 
		FormalDining, 
		First_Bedroom, 
		First_Bath, 
		Type, 
		Levels, 
		Arch, 
		Const, 
		Found, 
		Roof, 
		Windows, 
		Heat, 
		Cooling, 
		Age, 
		New, 
		Lot, 
		Acreage, 
		Basement, 
		Garage, 
		Parking, 
		Fireplace, 
		Gas, 
		Water, 
		Sewer, 
		Zoning, 
		SaTax, 
		TaxRate, 
		Asmnt, 
		Occupy, 
		Transp, 
		LvlCondo, 
		HOA, 
		SchoolDis, 
		SchoolPhone, 
		OhDate, 
		OhTime, 
		Auction, 
		TaxID, 
		SpecFin, 
		Comments, 
		FullName, 
		ListerComp, 
		CompAddy, 
		CompCity, 
		CompState, 
		CompZip, 
		PrimPhone, 
		OfficePhone, 
		PrimFax, 
		Cell, 
		ListerEmail, 
		Pic
	) Values (
		'" . $_POST['StrAddy'] . "', 
		'" . $_POST['City'] . "', 
		'" . $_POST['County'] . "', 
		'" . $_POST['State'] . "', 
		'" . $_POST['Suburb'] . "', 
		'" . $_POST['SubDiv'] . "', 
		'" . $_POST['Lst_Price'] . "', 
		'" . $_POST['Total_Rooms'] . "', 
		'" . $_POST['Bedrooms'] . "', 
		'" . $_POST['Baths'] . "', 
		'" . $_POST['FamilyRoom'] . "', 
		'" . $_POST['FormalDining'] . "', 
		'" . $_POST['First_Bedroom'] . "', 
		'" . $_POST['First_Bath'] . "', 
		'" . $_POST['Type'] . "', 
		'" . $_POST['Levels'] . "', 
		'".$arch."', 
		'".$const."', 
		'" . $_POST['Found'] . "', 
		'" . $_POST['Roof'] . "', 
		'".$windows."', 
		'".$heat."', 
		'".$cooling."', 
		'" . $_POST['Age'] . "', 
		'" . $_POST['New'] . "', 
		'" . $_POST['Lot'] . "', 
		'" . $_POST['Acreage'] . "', 
		'" . $_POST['Basement'] . "', 
		'" . $_POST['Garage'] . "', 
		".$park.", 
		'" . $_POST['Fireplace'] . "', 
		'" . $_POST['Gas'] . "', 
		'" . $_POST['Water'] . "', 
		'" . $_POST['Sewer'] . "', 
		'" . $_POST['Zoning'] . "', 
		'" . $_POST['SaTax'] . "', 
		'" . $_POST['TaxRate'] . "', 
		'" . $_POST['Asmnt'] . "', 
		'" . $_POST['Occupy'] . "', 
		'" . $_POST['Transp'] . "', 
		'" . $_POST['LvlCondo'] . "', 
		'" . $_POST['HOA'] . "', 
		'" . $_POST['SchoolDis'] . "', 
		'" . $_POST['SchoolPhone'] . "', 
		'" . $_POST['OhDate'] . "', 
		'" . $_POST['OhTime'] . "', 
		'" . $_POST['Auction'] . "', 
		'" . $_POST['TaxID'] . "', 
		'" . $_POST['SpecFin'] . "', 
		'" . $_POST['Comments'] . "', 
		'" . $_POST['FullName'] . "', 
		'" . $_POST['ListerComp'] . "', 
		'" . $_POST['CompAddy'] . "', 
		'" . $_POST['CompCity'] . "', 
		'" . $_POST['CompState'] . "', 
		'" . $_POST['CompZip'] . "', 
		'" . $_POST['PrimPhone'] . "', 
		'" . $_POST['OfficePhone'] . "', 
		'" . $_POST['PrimFax'] . "', 
		'" . $_POST['Cell'] . "', 
		'" . $_POST['ListerEmail'] . "', 
		'" . $_FILES['upload']['name'] . "'
	)"
) or die(mysql_error()); /* check if there was an error in the query,
							reliability is a must when entering data */
echo "You have succsessfuly posted a listing.
}
?>
</body>
</html>
<?php
/****************************************/
/*********** Page Functions *************/
/****************************************/

class PAGE_CHECKER
{
function check_post_variables()
{
	global $_POST;
	$die=false;
	foreach($_POST as $key => $value) {
		if($value == "") {
			if(!is_array($value)) {
				$die = true;
			}
		} 
	}
	return (!$die) ? true : false;
}
function check_variable($variable_value, $expected_values)
{
	if(is_array($expected_values)) {
		$match=0;
		foreach($expected_values as $key => $value) {
			if($variable_value == $value) {
				$match=1;
			}
		}
		return (($match === 1) ? true : false);
	} else {
		return (($variable_value == $expected_values) ? true : false);
	}
}
}
?>

Link to comment
Share on other sites

as thorpe said, narrow it down.  PHP tells you the line the error is on, so passing that on to us might help.  either way, the error means that the "array" you're trying to pass to a foreach() isn't actually an array at all.

Link to comment
Share on other sites

I suspect the problem is that you are using the foreach on an array which might not exist. If no-one checks any of your checkboxes for a particular type, then you'll get an error. Try checking to see if any have been selected@

 

<?php
if(count($yourarray) > 0){
//you can use the foreach here
}
?>

Link to comment
Share on other sites

The error is on every line that a for each ends at the top side of the script. You'll notice that I set up a page check function to check that the string is valid. Also Im getting the errors on page load...... which is strange do to the fact that the session shouldnt start till the submit button is pressed. I dunno Any help would be greatly appriciated. :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.