autodefrost Posted July 24, 2007 Share Posted July 24, 2007 I'm new to this, and have figured out how to do a few things, but now stuck. I have a from, everything works fine - but I'm trying to add checkbox, and have run into problems. I'm not sure how to define it in the PHP (adding it in the HTML is fine, but when I add the information in th PHP, I get errors) This is one of the things that I've tried: $Response= $_POST['Response'] ; "Response: $Response\n" . <? ---- $mailto = 'info@myemail.com' ; $subject = "Website Form" ; $formurl = "http://www.summerfestwindsor.org/main/index.html" ; $errorurl = "http://www.summerfestwindsor.org/main/" ; $thankyouurl = "http://www.summerfestwindsor.org/main/volunteer-thankyou.html" ; $uself = 1; // -------------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $phoneH = $_POST['phoneH'] ; $phoneW = $_POST['phoneW'] ; $address = $_POST['address'] ; $city = $_POST['city'] ; $province = $_POST['province'] ; $comments = $_POST['comments'] ; $eventnumber = $_POST['eventnumber'] ; $attend = $_POST['attend'] ; $http_referrer = getenv( "HTTP_REFERER" ); if (!isset($_POST['email'])) { header( "Location: $formurl" ); exit ; } if (empty($name) || empty($email) || empty($comments)) { header( "Location: $errorurl" ); exit ; } if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ; } if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments ); } $messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Email of sender: $email\n" . "Home phone of sender: $phoneH\n" . "Work phone of sender: $phoneW\n" . "Address of sender: $address\n" . "City of sender: $city\n" . "Province of sender: $province\n" . "eventnumber: $eventnumber\n" . "attend: $attend\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" ); header( "Location: $thankyouurl" ); exit ; ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>xxxx</title> </head> <body> <table align="center" width="85%"> <tr></tr> <tr> <td align="left"> <form action="feedback.php" method="post"> <table width="100%" border="0" cellpadding="5" cellspacing="2" summary="feedback form"> <tr> <td>Name:</td> <td><input type="text" name="name" size="25" /></td> </tr> <tr> <td>Email address:</td> <td><input type="text" name="email" size="25" /></td> </tr> <tr> <td>Phone (Work):</td> <td><input name="phoneW" type="text" id="phoneW" size="25" /></td> </tr> <tr> <td>Address:</td> <td><input name="address" type="text" id="address" size="25" /></td> </tr> <tr> <td>City:</td> <td><input name="city" type="text" id="city" size="25" /></td> </tr> <tr> <td>Province:</td> <td><input name="province" type="text" id="province" size="25" /></td> </tr> <tr> <td colspan="2">Comments:</td> </tr> <tr> <td colspan="2" align="center" valign="top"><textarea rows="15" cols="50" name="comments"></textarea></td> </tr> <tr> <td align="right"><label> <input name="Response" type="checkbox" id="Response" value="emailres" /> </label></td> <td align="left">Email response requested </td> </tr> <tr> <td align="right"><label> <input name="ResponseT" type="checkbox" id="ResponseT" value="teleres" /> </label></td> <td align="left"> Telephone response requested</td> </tr> <tr> <td align="center" colspan="2"> </td> </tr> <tr> <td align="center" colspan="2"> </td> </tr> <tr> <td align="left">Event Number: </td> <td align="left"><label> <input name="eventnumber" type="text" id="eventnumber" size="25" /> </label></td> </tr> <tr> <td align="center">Number of Attendees: </td> <td align="left"><input name="attend" type="text" id="attend" size="25" /></td> </tr> <tr> <td align="center" colspan="2"> </td> </tr> <tr> <td align="center" colspan="2"> </td> </tr> <tr> <td align="center" colspan="2"><input name="submit" type="submit" value="Send Feedback" /></td> </tr> </table> </form> </div></td> </tr> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
teng84 Posted July 24, 2007 Share Posted July 24, 2007 give us the error message? Quote Link to comment Share on other sites More sharing options...
maxudaskin Posted July 24, 2007 Share Posted July 24, 2007 First of all... $uself = 1; // -------------------- $headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ; Is a waste of time... Just write $headersep = false; Because that is what it returns anyways... Quote Link to comment Share on other sites More sharing options...
autodefrost Posted July 24, 2007 Author Share Posted July 24, 2007 The error message, is a white screen. After the form has been submitted, it just stays white - and doesn't take you to the 'thank you' page. Quote Link to comment 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.