larissahn Posted May 29, 2009 Share Posted May 29, 2009 Hi, I recently created a simple form for my website, http://www.utilaecology.org/research/lionfish_contact.php the feedback should be sent to my email, but I am not receiving anything. <?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $date = $_REQUEST['date'] ; $dive_site = $_REQUEST['dive_site'] ; $depth = $_REQUEST['depth'] ; $additional_information = $_REQUEST['additional_information'] ; if (!isset($_REQUEST['email'])) { header( "Location: http://www.utilaecology.org/contact/response.php" ); } elseif (empty($email) || empty($dive_site)) { header( "Location: http://www.utilaecology.org/contact/response.php" ); } else { mail ( "[email protected]", "Report Lionfish Sighting Form", "Date: $date\n", "Dive Site Location: $dive_site\n", "Depth: $depth\n", "Additional Information: $additional_information\n", "From: $name <$email>" ) ; header ( "Location: http://www.utilaecology.org/contact/response.php" ) ; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/160095-feedback-form/ Share on other sites More sharing options...
Alt_F4 Posted May 29, 2009 Share Posted May 29, 2009 i think you have added to many parameters to the mail function it should follow the format shown here: http://au.php.net/manual/en/function.mail.php try this $message = "Date: ".$date."\r\nDive Site Location: ".$dive_site."\r\nDepth: ".$depth."\r\nAdditional Information:". $additional_information."\r\n"; mail ( "[email protected]", "Report Lionfish Sighting Form", $message, "From: ".$name." <".$email.">" ) ; Quote Link to comment https://forums.phpfreaks.com/topic/160095-feedback-form/#findComment-844681 Share on other sites More sharing options...
BobcatM Posted May 29, 2009 Share Posted May 29, 2009 You are redirecting all statements to http://www.utilaecology.org/contact/response.php Try this and see if you can tell if it's going though the whole IF statement. <?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $date = $_REQUEST['date'] ; $dive_site = $_REQUEST['dive_site'] ; $depth = $_REQUEST['depth'] ; $additional_information = $_REQUEST['additional_information'] ; if (!isset($_REQUEST['email'])) { echo "No email entered"; } elseif (empty($email) || empty($dive_site)) { echo "Else If Statement"; } else { mail ( "[email protected]", "Report Lionfish Sighting Form", "Date: $date\n", "Dive Site Location: $dive_site\n", "Depth: $depth\n", "Additional Information: $additional_information\n", "From: $name <$email>" ) ; echo "Everything is good here"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/160095-feedback-form/#findComment-844682 Share on other sites More sharing options...
larissahn Posted May 29, 2009 Author Share Posted May 29, 2009 thank you, followed both your suggestions. does anybody know for the date option what code I'd need to display a popup showing a calendar? thank you. this is my new code: <?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $date = $_REQUEST['date'] ; $dive_site = $_REQUEST['dive_site'] ; $depth = $_REQUEST['depth'] ; $additional_information = $_REQUEST['additional_information'] ; $message = "Date: ".$date."\r\nDive Site Location: ".$dive_site."\r\nDepth: ".$depth."\r\nAdditional Information:". $additional_information."\r\n"; if (!isset($_REQUEST['email'])) { echo "No email entered." ; } elseif (empty($email) || empty($dive_site)) { echo "Else If Statement"; } else { mail ( "[email protected]", "Report Lionfish Sighting Form", $message, "From: ".$name." <".$email.">" ) ; header ( "Location: http://www.utilaecology.org/contact/response.php" ) ; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/160095-feedback-form/#findComment-844696 Share on other sites More sharing options...
BobcatM Posted May 29, 2009 Share Posted May 29, 2009 You can't do a popup in php, you will have to use Javascript if you want a popup calender. Quote Link to comment https://forums.phpfreaks.com/topic/160095-feedback-form/#findComment-844699 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.