Jump to content

dewey_witt

Members
  • Posts

    151
  • Joined

  • Last visited

    Never

Everything posted by dewey_witt

  1. OK i have this form(below) that the value of the checked check boxes inserted into my mysql table in a feild called Arch. Any help will be apriciated <td><input name="Arch[0]" type="checkbox" value="Traditional">Traditional</td> <td><input name="Arch[1]" type="checkbox" value="Victorian">Victorian</td> <td><input name="Arch[2]" type="checkbox" value="Ranch">Ranch</td> </tr> <tr> <td><input name="Arch[3]" type="checkbox" value="Cottage">Cottage</td> <td><input name="Arch[4]" type="checkbox" value="Transistional">Transistinal</td> <td><input name="Arch[5]" type="checkbox" value="Log">Log</td> </tr> <tr> <td><input name="Arch[6]" type="checkbox" value="Cape Cod">Cape Cod</td> <td><input name="Arch[7]" type="checkbox" value="Dutch">Dutch</td> <td><input name="Arch[8]" type="checkbox" value="Contemporary"> Contemporary</td> </tr> <tr> <td><input name="Arch[9]" type="checkbox" value="Salt Box">Salt Box</td> <td><input name="Arch[10]" type="checkbox" value="Historical">Historical</td> <td> <input name="Arch[11]" type="checkbox" value="Chalet">Chalet</td> </tr> <tr> <td><input name="Arch[12]" type="checkbox" value="Colonial">Colonial</td> <td><input name="Arch[13]" type="checkbox" value="Spanish">Spanish</td> <td> <input name="Arch[14]" type="checkbox" value="Tudor">Tudor</td> </tr> Keep in mind i am semi new to php and a colete dumbie. You will have to hold my hand lol
  2. Try This <?php $sql = "SELECT * FROM ipsr_garage WHERE userid = $userid"; $result= mysql_query($sql, $connection) or die (mysql_error()); $result= mysql_query($sql, $connection) or die (mysql_error()); if (mysql_num_rows($result) > 0) { while ($row = mysql_fetch_array($result)) { $year = $row['year']; $make = $row['make']; $model = $row['model']; echo "$year $make $model"; } } ?>
  3. I tried the checkbox and same result. Im at wits end........ The pets are no longer safe :|
  4. OK folkz........ Im having trouble with my forms and passing data. I can't seem to get my code to be able to pass more than one selection Or to be able to select more than one selection. I need it to be able for the user to select more than one anwser for this feild. Like "casements" and "Vinyl". Any Clues anyone? <select size="3" name="Windows[]" multiple> <option value="None Selected" selected="selected"> Please Select </option> <option value="Insulated "> Insulated </option> <option value="Vinyl "> Vinyl </option> <option value="Wood "> Wood </option> <option value="Alum "> Alum </option> <option value="Dbl Hung "> Dbl Hung </option> <option value="Storm "> Storm</option> <option value="Casement "> Casement </option> <option value="Bay "> Bay </option> <option value="Slider "> Slider </option> <option value="Picture "> Picture </option> <option value="Awning "> Awning </option> <option value="Garden "> Garden </option> <option value="Vinyl Aluminum Clad"> Vinyl Aluminum Clad </option> <option value="Other"> Other </option> </select>
  5. Where are the swaumi's of PHP when ya need em? :'(
  6. OK that gives me a good fix for showing more fields than one but, I can NOT check more than one option. I need to be able to select more than one opption and keep ALL the options selected. This means in one feild i have five choices. I need to be able to select three of the five. I hope this makes what Im trying to do clearer. Please help me
  7. OK here is a table and the corasponing code. If you notice some of the drop down form feilds have "multiple="multiple" as an attribute. For some reason I can't select more than one option. I need to be able to select multiple options. For quicker trouble shooting you only need troubleshoot one of the mutiple fields (windows, heat, or others) Any help would be apriciated. Thanks <? error_reporting(0); foreach ($_POST as $k => $v) { $_POST[$k] = stripslashes($v); } if ((!$_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']) || (!$_POST['Arch']) || (!$_POST['Const']) || (!$_POST['Found']) || (!$_POST['Roof']) || (!$_POST['Windows']) || (!$_POST['Heat']) || (!$_POST['Cooling']) || (!$_POST['Age']) || (!$_POST['New']) || (!$_POST['Lot']) || (!$_POST['Acreage']) || (!$_POST['Basement']) || (!$_POST['Garage']) || (!$_POST['Parking']) || (!$_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['CompCity']) || (!$_POST['CompState']) || (!$_POST['CompZip']) || (!$_POST['PrimPhone']) || (!$_POST['OfficePhone']) || (!$_POST['PrimFax']) || (!$_POST['Cell']) || (!$_POST['ListerEmail'])) { ?> <form method="post" enctype="multipart/form-data" onSubmit="return checkCheckBox(this)"> <table align="center" cellspacing="2"> <tr> <td valign="25"> Street Address: </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>Subdivision: </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>Total Rooms: </td><td><input name="Total_Rooms" type="text" size="5" maxlength="5" /></td> </tr> </table><br /> <center><strong>The Details</strong></center> <table align="center"><tr><td width="99">Bedrooms: </td> <td width="144"><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 width="105">Bath Rooms: </td><td width="150"><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><td width="100">Family Room: </td><td width="232"><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></tr><tr><td><font size="-1">Formal Dining: </font></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> <td><font size="-3">1st Floor Bedroom:</font> </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><font size="-3">1st Floor Bathroom: </font></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>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> <td><font size="-3"> Arch Type: </font></td> <td><select size="1" name="Arch" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Traditional "> Traditional </option> <option value="Ranch"> Ranch </option> <option value="Transitional "> Transitional </option> <option value="Cape Cod "> Cape Cod </option> <option value="Contemporary "> Contemporary </option> <option value="Historical "> Historical </option> <option value="Colonial "> Colonial </option> <option value="Tudor "> Tudor </option> <option value="Victorian "> Victorian </option> <option value="Cottage "> Cottage </option> <option value="Log "> Log </option> <option value="Dutch "> Dutch </option> <option value="Salt Box "> Salt Box </option> <option value="Chalet "> Chalet </option> <option value="Spanish "> Spanish </option> <option value="Other"> Other </option> </select></td></tr> <tr> <td>Construction : </td> <td><select size="1" name="Const" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Brick"> Brick </option> <option value="Stucco"> Stucco </option> <option value="Vinyl"> Vinyl </option> <option value="Shingle"> Shingle </option> <option value="Wood"> Wood </option> <option value="Block"> Block </option> <option value="Aluminum"> Aluminum </option> <option value="Log"> Log </option> <option value="Stone"> Stone </option> <option value="Cedar"> Cedar </option> <option value="EFIS"> EFIS </option> </select></td> <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" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Shingle "> Shingle </option> <option value="Slate "> Slate </option> <option value="Tile "> Tile </option> <option value="Composition "> Composition </option> <option value="Metal "> Metal </option> <option value="Membrane "> Membrane </option> <option value="Build Up "> Build Up </option> <option value="Asbestose "> Asbestos </option> <option value="Wood"> Wood </option> <option value="Other"> Other </option> </select> </td></tr> <tr><td>Windows: </td><td> <select size="1" name="Windows" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Insulated "> Insulated </option> <option value="Vinyl "> Vinyl </option> <option value="Wood "> Wood </option> <option value="Alum "> Alum </option> <option value="Dbl Hung "> Dbl Hung </option> <option value="Storm "> Storm</option> <option value="Casement "> Casement </option> <option value="Bay "> Bay </option> <option value="Slider "> Slider </option> <option value="Picture "> Picture </option> <option value="Awning "> Awning </option> <option value="Garden "> Garden </option> <option value="Vinyl Aluminum Clad"> Vinyl Aluminum Clad </option> <option value="Other"> Other </option> </select> </td><td>Heating: </td><td> <select size="1" name="Heat" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Gas "> Gas </option> <option value="Electric "> Electric </option> <option value="Oil "> Oil </option> <option value="Hot Water "> Hot Water </option> <option value="Wood "> Wood </option> <option value="Steam "> Steam </option> <option value="Solar "> Solar </option> <option value="Coal "> Coal </option> <option value="Forced Air "> Forced Air </option> <option value="Heat Pump "> Heat Pump </option> <option value="BaseBoard "> Baseboard </option> <option value="Radiant "> Radiant </option> <option value="Gravity "> Gravity </option> <option value="Space Heater "> Space Heater </option> <option value="Geothermal "> Geothermal </option> <option value="None"> None </option> </select> </td><td>Cooling: </td><td><select size="1" name="Cooling" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Central Air "> Central Air </option> <option value="Window Unti "> Window Unit </option> <option value="Attic Fan "> Attic Fan </option> <option value="Wall Unit "> Wall Unit </option> <option value="None"> None </option> </select></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>New Features: </td><td><input name="New" type="text" size="25" maxlength="50" /></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>Acreage: </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><td>Garage: </td><td><select size="1" name="Garage"> <option value="None Selected" selected="selected"> Please Select </option> <option value="1 Car Detached"> 1 Car Detached </option> <option value="2 Car Detached"> 2 Car Detached </option> <option value="3 Car Detached"> 3 Car Detached </option> <option value="1 Car Attached"> 1 Car Attached </option> <option value="2 Car Attached"> 2 Car Attached </option> <option value="3 Car Attached"> 3 Car Attached </option> <option value="Other"> Other </option> </select></td></tr> <tr><td>Parking: </td><td><select size="1" name="Parking" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Driveway "> Driveway </option> <option value="Garag e"> Garage </option> <option value="Street "> Street </option> <option value="Car Port "> Car Port </option> <option value="Assigned "> Assigned </option> <option value="Other"> Other </option> </select></td><td>Fireplace</td><td><select size="1" name="Fireplace" multiple="multiple" > <option value="None Selected" selected="selected"> Please Select </option> <option value="Wood"> Wood </option> <option value="Gas"> Gas </option> <option value="Electric"> Electric </option> <option value="Inoprable"> Inoprable </option> <option value="Other"> Other </option> </select></td><td>Gas: </td><td><select size="1" name="Gas" multiple="multiple"> <option value="None Selected" selected="selected"> Please Select </option> <option value="Natural"> Natural </option> <option value="Oil"> Oil </option> <option value="Rubber"> Rubber </option> <option value="Other"> Other </option> </select></td></tr> <tr><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><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> </table><br /> <center><strong>About the Area</strong></center> <table align="center"><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><td>Tax Rate: </td><td><input name="TaxRate" type="text" size="15" 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><td>Level Condo: </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="15" maxlength="15" /> </td></tr> <tr><td><font size="-3">School District: </font></td> <td><input name="SchoolDis" type="text" size="20" maxlength="15" /></td><td>School Phone: </td><td><input name="SchoolPhone" type="text" size="15" maxlength="15" /></td></tr> </table><br /> <strong><center>Will there be an open house?</center></strong> <table align="center"><tr><td>Open House Date: </td><td><input name="OhDate" type="text" size="10" maxlength="15" value="10/10/2000" /></td> <td>Open House Time: </td><td><input name="OhTime" type="text" value="12:00am" size="10" maxlength="10" /></td><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>Tax ID (house)</td><td><input name="TaxID" type="text" size="20" maxlength="25" /></td></tr> <tr><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> </table><br /> <table align="center"><tr><td><center>Comments (limit 500 characters)</center></td></tr> <tr><td><tr><td><center><textarea name="Comments" cols="69" rows="13"></textarea></center></td></tr> </table><br /><center><strong>Information About You</strong></center> <table> <tr> <td>Your Full Name: </td> <td><input name="FullName" type="text" size="50" maxlength="50" /></td> <td> Your 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> <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 Phone: </td> <td><input name="Cell" type="text" size="20" maxlength="20" /></td> </tr> <tr> <td>Your Email: </td> <td><input name="ListerEmail" type="text" size="40" maxlength="40" /></td> <td> I agree: <input type="checkbox" value="0" name="agree"><SCRIPT language=JavaScript> function checkCheckBox(f){ if (f.agree.checked == false ) { alert('You Must Agree To the terms and conditions Before Moving On.'); return false; }else return true; } </SCRIPT></td><td><img src="terms.jpg" width="206" height="40" alt="By posting you agree that the information is correct to the best of your knowledge, that the listing is active, and that you have all rights to post the listing on our site either by ownership or contract." /></td> </tr><tr><td colspan="4"><center><input type="file" name="upload" /></center></td></tr> </table> <br /> <center><input name="submit" type="submit" value="Post Listing" /> or <input name="reset" type="reset" value="Clear Form" /></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 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="some_table"; $connection= @mysql_connect("some_server", "somedb_user", "somedb_password") or die(mysql_error()); mysql_select_db($db_name, $connection) or die(mysql_error()); mysql_query(" INSERT INTO $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'] . "', '" . $_POST['Arch'] . "', '" . $_POST['Const'] . "', '" . $_POST['Found'] . "', '" . $_POST['Roof'] . "', '" . $_POST['Windows'] . "', '" . $_POST['Heat'] . "', '" . $_POST['Cooling'] . "', '" . $_POST['Age'] . "', '" . $_POST['New'] . "', '" . $_POST['Lot'] . "', '" . $_POST['Acreage'] . "', '" . $_POST['Basement'] . "', '" . $_POST['Garage'] . "', '" . $_POST['Parking'] . "', '" . $_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'] . "' )" ); echo "ok"; } ?> </td></tr></table>
  8. Awsome! He agreed! One question tho. With the new multiple attribute will it still enter all selected data into the db or will i need further mod?
  9. Awsome Im going to leave this post open till I talk with him *calling now* I'll post again if talks fail lol
  10. All fine and dandy. And first thank you for your help. But the client wants Checkboxes. Im having an issue converting. Is the "multiple" tag you just game me part of the checkbox naming atributes or the dropdown attributs?
  11. OK so my client Has changed his mind reguarding the layout style of a form. He wants to have checkboxes where there are dropdown menu's So he can select more than one option. This is kewl with me Yet I used the naming attribute Name="heating[]" (to handle array) in all checkboxes releated to heating instead of Name="heating" that was used on the orriginal form. It keeps telling me I have missed Fields on submission. :/ Im not getting it. Anyone help?
  12. Frost dude your awsome! Exacly what i was looking for. Chocopi was on the right track too thanks for all you help Issue resolved.
  13. OK what do i use in the header to go to the last page if the script fails..... I do not what to go forward to the page again but backwards in The local browsers history. Any help? anf can i still echo?
  14. I started using php cause some idiot that hired me to do a simple "html and java" web site started adding database's required functions on me. (yes i learned about contracts ........ the hard way) Anyway, I downloaded a book off limewire. PHP and Mysql. Then I bought an awsome book called php mysql on apache. you should check both out at a local library or something
  15. Date = take a girl out for courtship. you wouldnt want my granny tho. she is OLD and prunned up! Thank you for all your wonderfull help!
  16. Correct me if Im wrong but arn't session destroyed automaticly when the user leaves the site? This is the case for me on a couple of my sites. when you leave the site.....and come back.... you have to start the login process over. isn't that a sign of session destroy? May not anwser your question, but Im inqizitive and want to know
  17. OK here is something that send mail rather nicley. If you need checks and ballances you can find some additional code in the php tutorials here on phpfreaks. <?php // send an e-mail $msg = "A User Has dome something.\nThe information is:\n\n"; $msg .= "First name: " . $_POST[FName] . "\n"; //these are some sample variables \\for amusment purposes. this is data input froma form and sent in mail. $msg .= "Lastname: " . $_POST[LName] . "\n"; $msg .= "Email: " . $_POST[Email] . "\n"; $msg .= "Organization: " . $_POST[Org] . "\n"; $msg .= "Address: " . $_POST[Addy] . "\n"; $msg .= "City: " . $_POST[City] . "\n"; $msg .= "State: " . $_POST[state] . "\n"; $msg .= "Zip: " . $_POST[Zip] . "\n"; $msg .= "Phone: " . $_POST[Phone] . "\n\n"; $to = "some_name@some_domain.com"; $subject = "Some_Subject"; $headers = "From: someone@sumdomain.com\n"; $headers .= "Reply-To: someone@somedomain.com\n\n"; mail($to, $subject, $msg, $headers); \// this sends the user to whatever url you want them to go to after thay have made their post or provided input. header( "Location: http://www.somedomain.com"); exit; } // CLose the php block. ?> Hope it helps
  18. Sweeeeeeeeeeeeet. Your awsome........ what do i owe you? A date with granny? JP For real I owe you one..... one last thing..... what do i have to modify to inert the file name into mysql database? ??? sql=" INSERT Pic Into somedb VALUES (.\"$file[name].\" ???????
  19. OK im still not seeing how to intergrate the two. If anyone knows I'll.... I dunno I was gonna say kiss you on the mouth but ewwwww lol I realy realy realy realy need a fix to this. BADLY. Wanna do my sis? Ten bux? I have candy
  20. The code to preform the upload isnt on here. this is the code for all the other feilds. I need to intergrate the other code into this. I have tried a gazzilion methods......... none worked. and sorry for not useing the color coding I'm New here :/ <?php if (!isset($_SESSION)) { session_start(); } //Check to see if all the data was entered and return them to the page if not. if ((!$_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']) || (!$_POST['Arch']) || (!$_POST['Const']) || (!$_POST['Found']) || (!$_POST['Roof']) || (!$_POST['Windows']) || (!$_POST['Heat']) || (!$_POST['Cooling']) || (!$_POST['Age']) || (!$_POST['New']) || (!$_POST['Lot']) || (!$_POST['Acreage']) || (!$_POST['Basement']) || (!$_POST['Garage']) || (!$_POST['Parking']) || (!$_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['CompCity']) || (!$_POST['CompState']) || (!$_POST['CompZip']) || (!$_POST['PrimPhone']) || (!$_POST['OfficePhone']) || (!$_POST['PrimFax']) || (!$_POST['Cell']) || (!$_POST['ListerEmail'])) { // you will probably want to modify this - if you just send the user back to the page they were // on without telling them they were missing some information, they won't know that their // record wasn't saved. This is bad form! header("Location: http://www.ezsellnow.com/Post_Listings.php"); echo "It seems you have missed a feild or more. Please Check your Information Carefully"; exit; } // only save the information if this page was accessed with POST information if (isset($_POST)) { //Create a variable to hold the database name. $db_name="db_name"; //create a variable to hole the database name. $table_name="Post"; //Add the conection information. $connection= mysql_connect("Server", "username", "password")or die(mysql_error()); //Select the database $db = mysql_select_db($db_name, $connection) or die(mysql_error()); //Create the sql statement. $sql= "INSERT INTO $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) 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'] . "', '" . $_POST['Arch'] . "', '" . $_POST['Const'] . "', '" . $_POST['Found'] . "', '" . $_POST['Roof'] . "', '" . $_POST['Windows'] . "', '" . $_POST['Heat'] . "', '" . $_POST['Cooling'] . "', '" . $_POST['Age'] . "', '" . $_POST['New'] . "', '" . $_POST['Lot'] . "', '" . $_POST['Acreage'] . "', '" . $_POST['Basement'] . "', '" . $_POST['Garage'] . "', '" . $_POST['Parking'] . "', '" . $_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'] . "')"; //Create a variable to hold the result of the query. $result = mysql_query($sql, $connection) or die(mysql_error()); //Show a success Message. if ($result) { echo "SUCCESS - your record was saved."; // you might just want to redirect them here and only warn them if there was an error } else { echo "OOPS - there has been an error. Please Try Again" . mysql_error(); } } //Close PHP block. ?> Did this help?
  21. Gary there are a number of things that could be fouled in an email script. Here is a snippet i hope helps: $msg = "Topic of e-mail goes here\nThe information is:\n\n"; $msg .= "First name: " . $_POST[FName] . "\n"; $msg .= "Lastname: " . $_POST[LName] . "\n"; $msg .= "Email: " . $_POST . "\n"; $msg .= "Organization: " . $_POST[Org] . "\n"; $msg .= "Address: " . $_POST[Addy] . "\n"; $msg .= "City: " . $_POST[City] . "\n"; $msg .= "State: " . $_POST[state] . "\n"; $msg .= "Zip: " . $_POST[Zip] . "\n"; $msg .= "Phone: " . $_POST[Phone] . "\n\n"; $to = "receipiant@somedomain.com"; $subject = "The subject of the e-mail goes here"; $headers = "From: sender@sendersdomain.com\n"; $headers .= "Reply-To: sender@senders domain.com\n\n"; mail($to, $subject, $msg, $headers); //sends the poster to a specified location after the script runs. header( "Location: http://www.somelocation.com"); exit; Also it depends on your hosting. If your hosting is windows most hosting providers run php in "safe mode" on windows... this doesnt allow for e-mail scripts in php. I recently had this problem with godaddy. Their tech support knew nothing I called 823765928365 times untill finaly someone had some info for me on the matter. WORD OF ADVICE: DO NOT HOST ON GODADDY WINDOWS HOSTING!!! Their linux servers are awsome tho
  22. OK Im on a deadline here. Last script for the site. Im stuck. Literaly. I have a form that i need to add an image upload element to. What i need is to upload the image to the server, and store the image name in mysql database. Im semi new to php. all my other scripts have worked I don't know what Im doing wrong. Well ok here if the php code. WARNING THIS IS A HUGE CODE! LOL But realy pleeeeeeeeease Helppppppp! OK this is the php for the form without the image upload: <?php if (!isset($_SESSION)) { session_start(); } //Check to see if all the data was entered and return them to the page if not. if ((!$_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']) || (!$_POST['Arch']) || (!$_POST['Const']) || (!$_POST['Found']) || (!$_POST['Roof']) || (!$_POST['Windows']) || (!$_POST['Heat']) || (!$_POST['Cooling']) || (!$_POST['Age']) || (!$_POST['New']) || (!$_POST['Lot']) || (!$_POST['Acreage']) || (!$_POST['Basement']) || (!$_POST['Garage']) || (!$_POST['Parking']) || (!$_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['CompCity']) || (!$_POST['CompState']) || (!$_POST['CompZip']) || (!$_POST['PrimPhone']) || (!$_POST['OfficePhone']) || (!$_POST['PrimFax']) || (!$_POST['Cell']) || (!$_POST['ListerEmail'])) { // you will probably want to modify this - if you just send the user back to the page they were // on without telling them they were missing some information, they won't know that their // record wasn't saved. This is bad form! header("Location: http://www.ezsellnow.com/Post_Listings.php"); echo "It seems you have missed a feild or more. Please Check your Information Carefully"; exit; } // only save the information if this page was accessed with POST information if (isset($_POST)) { //Create a variable to hold the database name. $db_name="db_name"; //create a variable to hole the database name. $table_name="Post"; //Add the conection information. $connection= mysql_connect("Server", "username", "password")or die(mysql_error()); //Select the database $db = mysql_select_db($db_name, $connection) or die(mysql_error()); //Create the sql statement. $sql= "INSERT INTO $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) 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'] . "', '" . $_POST['Arch'] . "', '" . $_POST['Const'] . "', '" . $_POST['Found'] . "', '" . $_POST['Roof'] . "', '" . $_POST['Windows'] . "', '" . $_POST['Heat'] . "', '" . $_POST['Cooling'] . "', '" . $_POST['Age'] . "', '" . $_POST['New'] . "', '" . $_POST['Lot'] . "', '" . $_POST['Acreage'] . "', '" . $_POST['Basement'] . "', '" . $_POST['Garage'] . "', '" . $_POST['Parking'] . "', '" . $_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'] . "')"; //Create a variable to hold the result of the query. $result = mysql_query($sql, $connection) or die(mysql_error()); //Show a success Message. if ($result) { echo "SUCCESS - your record was saved."; // you might just want to redirect them here and only warn them if there was an error } else { echo "OOPS - there has been an error. Please Try Again" . mysql_error(); } } //Close PHP block. ?> OK Now again I need to upload a photo to server and record the pic name in this db. please help!
  23. :-\ Well if the script that handles the email sends a "bulk mail" to more than three addresses at a time then it will be marked as spam ny most e-mail clients. The mail has to be sent individualy to avoid the spam folder. thhis shouldn't be too daunting of a task. Hope I helped
×
×
  • 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.