inquisitive Posted September 5, 2008 Share Posted September 5, 2008 Alright I am trying to to obviously upload my form into the database...here is my following code: <?php // plug globals include("db_connect.php"); include("config.php"); include("functions.php"); // turn on ad footer // 1=on 0=off $foot_ad=1; ?> <?php $db="mydb"; $link = mysql_connect("myserver", "mylogin", "mypass"); if (! $link) die("Our database is experiencing technical difficulties. Please contact our Webmaster"); else{ mysql_select_db($db , $link) or die("Select DB Error: ".mysql_error()); } $submit = $_POST["Submit"]; if ($submit == "Submit") { $submit = $_POST["Submit"]; $form1 = $_POST["textfield1"]; $form2 = $_POST["textfield2"]; $form3 = $_POST["textfield3"]; $form4 = $_POST["textfield4"]; $form5 = $_POST["textfield5"]; $form6 = $_POST["textfield6"]; $form7 = $_POST["textfield7"]; $form8 = $_POST["textfield8"]; $form9 = $_POST["textfield9"]; $form10 = $_POST["textfield10"]; $form11 = $_POST["textfield11"]; $form12 = $_POST["textfield12"]; $form13 = $_POST["textfield13"]; mysql_query ("INSERT INTO newsletter_signup ( company_name, address, city, state, zip, sales_email, production_email, office_email, service_email, phone, fax, questions, nrgca_member) values ('$form1','$form2','$form3','$form4','$form5','$form6','$form7','$form8','$form9','$form10','$form11','$form12','$form13')"); $to = "[email protected]"; $from = "[email protected]"; $subject = "Contact Request from - ".$_SERVER['HTTP_HOST']." by " .$form1." " .$form2; $message = "First Name: " .$form1 ."<br>" ."Last Name: " .$form2 ."<br>" ."Address: " .$form3 ."<br>" ."City: " .$form4 ."<br>" ."State: " .$form5 ."<br>Zipcode: " .$form6 ."<br>Home Phone: " .$form7 ."<br>Alternate Phone: " .$form8 ."<br>Best Time to Call: " .$form9 ."<br>Email: " .$form10 ."<br>Type of Project: " .$form11 ."<br>Type of Gutter: " .$form12 ."<br>Do you Need financing?: " .$form13; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: $from"; mail($to,$subject,$message,$headers); ?> <META HTTP-EQUIV=Refresh CONTENT="0; URL=newsletter-signup2.php"> <? } ?> Quote Link to comment https://forums.phpfreaks.com/topic/122865-help-with-sending-form-data-to-database/ Share on other sites More sharing options...
fenway Posted September 5, 2008 Share Posted September 5, 2008 Since we have no idea what to do with all of that code, you'll have to actually explain your problem. Quote Link to comment https://forums.phpfreaks.com/topic/122865-help-with-sending-form-data-to-database/#findComment-634543 Share on other sites More sharing options...
inquisitive Posted September 5, 2008 Author Share Posted September 5, 2008 Quite simply the information does not post to the database and the thankyou page doesn't load...the same page loads after the submission with all clear inputs... Quote Link to comment https://forums.phpfreaks.com/topic/122865-help-with-sending-form-data-to-database/#findComment-634556 Share on other sites More sharing options...
fenway Posted September 5, 2008 Share Posted September 5, 2008 Echo the string that your'e sending to mysql_query() Quote Link to comment https://forums.phpfreaks.com/topic/122865-help-with-sending-form-data-to-database/#findComment-634868 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.