aebstract Posted December 17, 2008 Share Posted December 17, 2008 Probably something simple, and I hope it is, but my contact form isn't working atm. It is echoing out every error that is made at the top of the page. So it sees the variables as empty. <?php if (isset ($_POST['submit'])) { if (empty ($_POST['name2'])) { $problem = TRUE; echo "PROBLEM NAME"; } if (empty ($_POST['company'])) { $problem = TRUE; echo "PROBLEM COMPANY"; } if (empty ($_POST['email'])) { $problem = TRUE; echo "PROBLEM EMAIL"; } if (empty ($_POST['phone1'])) { $problem = TRUE; echo "PROBLEM P1"; } if (empty ($_POST['phone2'])) { $problem = TRUE; echo "PROBLEM P2"; } if (empty ($_POST['phone3'])) { $problem = TRUE; echo "PROBLEM P3"; } if (empty ($_POST['address2'])) { $problem = TRUE; echo "PROBLEM ADDRESS"; } if (empty ($_POST['city'])) { $problem = TRUE; echo "PROBLEM CITY"; } if (empty ($_POST['state'])) { $problem = TRUE; echo "PROBLEM STATE"; } if (empty ($_POST['zip'])) { $problem = TRUE; echo "PROBLEM ZIP"; } if (empty ($_POST['level'])) { $problem = TRUE; echo "PROBLEM LEVEL"; } if (!$problem) { $name2 = $_POST['name2']; $company = $_POST['company']; $email = $_POST['email']; $phone1 = $_POST['phone1']; $phone2 = $_POST['phone2']; $phone3 = $_POST['phone3']; $address2 = $_POST['address2']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $emailbody = " $name2<br /> $company<br /> $email<br /> $phone1 - $phone2 - $phone3<br /> $address2<br /> $city, $state $zip <br /><br /> Type: $type "; $to = 'aebstract@gmail.com' . ', '; // note the comma // subject $subject = 'Contingency Form'; // message $message = " <html> <head> </head> <body> $emailbody </body> </html> "; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'To: Todd Berry <aebstract@gmail.com>' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); header("Location: contform2.php"); } else { echo "PROBLEM"; } } ?> <html> <head> <style type="text/css"> body { text-align: center; background-color: #000000; margin: 0px; spacing: 0px; } ul { font-family: arial; font-size: 15px; margin-left: 50px; margin-right: 20px; } li { padding: 5px; } h1 { color: #ff0000; font-family: arial; font-size: 25px; margin-left: 55px; } h2 { color: #000000; font-family: arial; font-size: 20px; text-align: right; } </style> </head> <body> <div style="background-color: #FFFFFF; width: 950px; text-align: left; margin-left: auto; margin-right: auto;"> <img src="orsca.jpg" style="float: right;" /><img src="spacer.gif" height="150" /> <h1>ORSCA CONTINGENCY PROGRAM</h1> <p style="padding-left:25px; padding-right:25px; font-size: 17px; font-family: arial;">A contingency sponsorship program is an advertisement program like no other. A sponsorship program where the racer purchases your product or service before they are elegible for your sponsorship dollars. On top of that, the racer advertises your company or brand on their vehicle throughout the event and you only pay them if they are a winner or runner-up. Contingency sponsorship is an incentive program of sorts. One where you're not only exposing thousands of potential customers to your company or brand but you're ensuring that racers have an even greater reason to purchase your products or services.</p> <p style="padding-left:25px; padding-right:25px; font-size: 17px; font-family: arial;">Let us face it, you will not find a racer that thinks they are going to lose on any given weekend. Each and every racer believes that he or she can win and they are right. On any given weekend anyone can win a drag race. With the right performance parts and tuning a racer can set themselves up to have that little edge. Remember, what is fast on Sunday sells on Monday.</p> <p style="padding-left:25px; padding-right:25px; font-size: 17px; font-family: arial;">So how does this contingency program work? There is a list of criteria a racer must meet in order to receive any monetary compensation.</p> <ul> <li>Competitors must first purchase the nominated product or service and be actively using the product or service before they are eligible for your contingency rewards.</li> <li>Your company or product decal must be displayed in an easy to view position on the race car.</li> <li>Sponsors may include special requirekents such as proof of purchase, serial numbers, etc.</li> <li>Any competitor found falsly claiming product use or applying decals after start of the event will forfeit all contingency rewards for said event.</li> <li>Competitors must be a member of the Outlaw Racing Street Car Association to be eligible for prizes.</li> <li>Contigency rewards are limited only to finishers designated by sponsor. (EX: winner and runner-up)</li> <li>ORSCA will inspect all contingency winning cars for proper sticker placement, part receipt, etc.</li> </ul> <br /><br /><br /> <h1>SPONSOR WILL RECEIVE THE FOLLOWING</h1> <ul> <li>Company or product banner along race wall.</li> <li>PA Announcements promoting your company and/or products.</li> <li>All promos will have sponsoring company's logo (ex: t-shirts, flyers, etc.)</li> <li>ORSCA will post all results for contingency payouts along with sponsor mention.</li> <li>All sponsored cars will run your logo.</li> <li>ORSCA will examine all cars making sure all criteria is met for competitor eligibility</li> </ul> <br /><br /> <h1>SIGN UP</h1> <form action="contform.php" method="post" name"contact"> <table cellspacing="0" cellpadding="10" style="color:#000000; font-family: arial; font-size: 13px;" align="center"> <tr><td valign="top"> <br /> <h2>Contingency Levels </h2> <?php echo " <p> <table cellspacing=\"0\" cellpadding=\"5\" style=\"color:#999999; font-family: arial; font-size: 13px;\" align=\"right\"> <tr style=\"color:#000000; font-family: arial; font-size: 13px;\"><td> Level </td><td width=10></td><td> Winner </td><td width=10></td><td> Runner Up </td></tr> <tr bgcolor=\"#000000\"><td> <input type=\"radio\" name\"level\" value=\"a\" checked />A </td><td width=10></td><td> 300 </td><td width=10></td><td> 150 </td></tr> <tr bgcolor=\"#333333\"><td> <input type=\"radio\" name\"level\" value=\"b\" />B </td><td width=10></td><td> 200 </td><td width=10></td><td> 100 </td></tr><tr bgcolor=\"#000000\"><td> <input type=\"radio\" name\"level\" value=\"c\" />C </td><td width=10></td><td> 100 </td><td width=10></td><td> 50 </td></tr> </table> </p> <p style=\"color:#000000; font-family: arial; font-size: 15px;\"><br /><br />There will be a one-time administrative setup fee of $1800.</p> "; ?> </td><td valign="top"> <?php echo " <table cellspacing=\"0\" cellpadding=\"10\" style=\"color:#999999; font-family: arial; font-size: 13px;\"> <tr bgcolor=\"#000\"><td align=\"right\"> Name </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"name2\" value=\"$_POST[name2]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Company Name </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"company\" value=\"$_POST[company]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> Email </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"email\" value=\"$_POST[emalil]\" size=\"30\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> Phone Number </td><td> <input type=\"text\" maxlength=\"3\" class=\"textfield2\" name\"phone1\" value=\"$_POST[phone1]\" size=\"3\" /> <input type=\"text\" maxlength=\"3\" class=\"textfield2\" name\"phone2\" value=\"$_POST[phone2]\" size=\"3\" /> <input type=\"text\" maxlength=\"4\" class=\"textfield2\" name\"phone3\" value=\"$_POST[phone3]\" size=\"4\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Address </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"address2\" value=\"$_POST[address2]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> City, State </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"city\" value=\"$_POST[city]\" size=\"13\" /> <input type=\"text\" maxlength=\"2\" class=\"textfield2\" name\"state\" value=\"$_POST[state]\" size=\"2\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Zip </td><td align=\"right\"> <input type=\"text\" maxlength=\"5\" class=\"textfield2\" name\"zip\" value=\"$_POST[zip]\" size=\"5\" /> </td></tr> <tr><td align=\"right\"> </td><td align=\"right\"> <input type=\"submit\" name=\"submit\" value=\"Submit\" /> </td></tr> </table> "; ?> </td> </tr> </table> </form> </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/137431-solved-variables-arent-posting/ Share on other sites More sharing options...
twm Posted December 17, 2008 Share Posted December 17, 2008 You are missing the = sign in every form element ( name\"name2\" should be name=\"name2\" ) <?php echo " <table cellspacing=\"0\" cellpadding=\"10\" style=\"color:#999999; font-family: arial; font-size: 13px;\"> <tr bgcolor=\"#000\"><td align=\"right\"> Name </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"name2\" value=\"$_POST[name2]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Company Name </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"company\" value=\"$_POST[company]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> Email </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"email\" value=\"$_POST[emalil]\" size=\"30\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> Phone Number </td><td> <input type=\"text\" maxlength=\"3\" class=\"textfield2\" name\"phone1\" value=\"$_POST[phone1]\" size=\"3\" /> <input type=\"text\" maxlength=\"3\" class=\"textfield2\" name\"phone2\" value=\"$_POST[phone2]\" size=\"3\" /> <input type=\"text\" maxlength=\"4\" class=\"textfield2\" name\"phone3\" value=\"$_POST[phone3]\" size=\"4\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Address </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"address2\" value=\"$_POST[address2]\" size=\"20\" /> </td></tr> <tr bgcolor=\"#000\"><td align=\"right\"> City, State </td><td> <input type=\"text\" maxlength=\"20\" class=\"textfield2\" name\"city\" value=\"$_POST[city]\" size=\"13\" /> <input type=\"text\" maxlength=\"2\" class=\"textfield2\" name\"state\" value=\"$_POST[state]\" size=\"2\" /> </td></tr> <tr bgcolor=\"#333333\"><td align=\"right\"> Zip </td><td align=\"right\"> <input type=\"text\" maxlength=\"5\" class=\"textfield2\" name\"zip\" value=\"$_POST[zip]\" size=\"5\" /> </td></tr> <tr><td align=\"right\"> </td><td align=\"right\"> <input type=\"submit\" name=\"submit\" value=\"Submit\" /> </td></tr> </table> "; ?> Quote Link to comment https://forums.phpfreaks.com/topic/137431-solved-variables-arent-posting/#findComment-718153 Share on other sites More sharing options...
aebstract Posted December 17, 2008 Author Share Posted December 17, 2008 ha =D thanks Quote Link to comment https://forums.phpfreaks.com/topic/137431-solved-variables-arent-posting/#findComment-718158 Share on other sites More sharing options...
Maq Posted December 17, 2008 Share Posted December 17, 2008 Probably something simple Quote Link to comment https://forums.phpfreaks.com/topic/137431-solved-variables-arent-posting/#findComment-718161 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.