|
laticca8 -> RE: how to assign check box items to an array (8/22/2005 22:23:55)
|
tailslide, i thought this was resolved, but it isn't. i guess since the name of all the checkboxes is the same (service), the selections do not post to the database. it does validate, but there are no "0"s in the appropriate column for the selected service. [&:] for reference, the page that posts the variables has the following script: <? if ($_POST["sent"] == "Submit Form") { $DBhost = "localhost"; $DBuser = "********"; $DBpass = "********"; $DBName = "********"; $table = "information"; $id = $_POST['id']; $name = $_POST['name']; $contactmethod = $_POST['contactmethod']; $email = $_POST['email']; $address = $_POST['address']; $referral = $_POST['referral']; $bizstartup = $_POST['bizstartup']; $bizcredit = $_POST['bizcredit']; $_501c3setup = $_POST['_501c3setup']; $_529plan = $_POST['_529plan']; $_401k = $_POST['_401k']; $disabilityins = $_POST['disabilityins']; $string1 = "Thank you for your interest!"; $string2 = "We will promptly send the requested information to"; $string3 = "We look forward to working with you!"; mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database"); @mysql_select_db("$DBName") or die("Unable to select database $DBName"); $sqlquery = "INSERT INTO $table VALUES('$id','$name','$contactmethod','$email','$address','$referral','$bizstartup','$bizcredit','$_501c3setup','$_529plan','$_401k','$disabilityins',NOW())"; $results = mysql_query($sqlquery); mysql_close(); if ($contactmethod == "Email") { echo "$string1 $string2 $email.<br><br>"; } else { echo "$string1 $string2 $address.<br><br>"; } echo "$string3"; } ?>
|
|
|
|