Jump to content

chrisharrigan426

New Members
  • Posts

    3
  • Joined

  • Last visited

chrisharrigan426's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Could any one take a look at my php forum script? The links are set correctly I can get to my confimation site but i dont recieve the email after submiting it I would greatly appreciate anyone givng me pointers <?php /* This first bit sets the email address that you want the form to be submitted to. You will need to change this value to a valid email address that you can access. */ $webmaster_email = "___________@gmail.com"; /* This bit sets the URLs of the supporting pages. If you change the names of any of the pages, you will need to change the values here. */ $feedback_page = "feedback_form.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html"; /* This next bit loads the form field data into variables. If you add a form field, you will need to add it here. */ $email_address = $_POST['email_address'] ; $full_name = $_POST['full_name'] ; $phone_number = $_POST['phone_number'] ; $comments = $_POST['comments'] ; $fudge_brownie = $_POST['fudge_brownie'] ; $italian_biscotti = $_POST['italian_biscotti'] ; $chocolatechip_cookies = $_POST['chocolatechip_cookies'] ; $oatmeal_cookie = $_POST['oatmeal_cookie'] ; $french_bread = $_POST['french_bread'] ; $kaiser_delirolls = $_POST['kaiser_delirolls'] ; $hamburger_rolls = $_POST['hamburger_rolls'] ; $sub_rolls = $_POST['sub_rolls'] ; $slider_rolls = $_POST['slider_rolls'] ; $snickerdoodle_cookies = $_POST['snickerdoodle_cookies'] ; $sticky_buns = $_POST['sticky_buns'] ; $woopie_pie = $_POST['woopie_pie'] ; $coconut_macaroons = $_POST['coconut_macaroons'] ; $special_comments = $_POST['special_comments'] ; /* The following function checks for email injection. Specifically, it checks for carriage returns - typically used by spammers to inject a CC list. */ function isInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } // If the user tries to access this script directly, redirect them to the feedback form, if (!isset($_POST['email_address'])) { header( "Location: $feedback_page" ); } // If the form fields are empty, redirect to the error page. elseif (empty($email_address) || empty($comments)) { header( "Location: $error_page" ); } // If email injection is detected, redirect to the error page. elseif ( isInjected($email_address) ) { header( "Location: $error_page" ); } // If we passed all previous tests, send the email then redirect to the thank you page. else { mail( "$webmaster_email", "DessertsOnDemandOrder", $special_comments, $coconut_macaroons, $woopie_pie, $sticky_buns, $snickerdoodle_cookies, $slider_rolls, $sub_rolls, $hamburger_rolls, $kaiser_delirolls, $french_bread, $oatmeal_cookie, $chocolatechip_cookies, $italian_biscotti, $fudge_brownie, $comments, $phone_number, $full_name, "From: $email_address" ); header( "Location: $thankyou_page" ); } ?>
  2. Hello, thank you so much for your help after i put it all in the page, i set the form action to it self, and change the feedback page also to its self but when i hit submit it seems to not do anything is there a problem with the form action= ? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Desserts on Demand|Summer Cartering</title> <link rel="stylesheet" type="text/css" href="bootstrap.css" > <link rel="stylesheet" type="text/css" href="dessertsondemand.css"> <meta name="description" content="Desserts on Demand"> <meta name="description" content="Barrington"> <meta name="description" content="New Hampshire Catering"> <meta name="description" content="Pat briduea"> <meta name="description" content="Skylight Dining Room"> <meta name="keywords" content="Pat Briduea "> <meta name="author" content="Pat Briduea"> <meta charset="UTF-8"> </head> <style> #content { font-size:15px height:100px; overflow:scroll; } /* FORM BUTTON */ } #submit { background-color: #; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:6px; color: #fff; font-family: 'Oswald'; font-size: 20px; text-decoration: none; cursor: pointer; border:none; } #submit:hover { border: none; background:#000000; box-shadow: 0px 0px 1px #777; } </style> <center> <body> <div id="container" style="width:900px;vertical-align: middle;"> <center> <div id="header" style="background-color:#ffffff; border:1px solid white; border-top-left-radius:7px; border-top-right-radius:7px; height: 192px; margin-top: 8px; margin-bottom: 8px;"> <center><h1> <img src="logo.PNG" width="197" height="167" alt="" longdesc="file://///storage/graduates2015/christopher.harrigan/My Documents/e biss/dessertsondemand/dessertsondemandlogo.jpg" /> </h1> </center> </div> <div id="menu" style="background-color:#ffffff;height:789px;width:225px;float:left;"> <!-- buttons --> <br></br> <button style="width:170px;height:35px;background-color:#87D163;" type="button" class="btn btn-default"> <a href="dessertsondemandhomepage.html"> Home </a> </button> <br></br> <br></br> <button style="width:170px;height:35px;background-color:#87D163;" type="button" class="btn btn-default"> <a href="dessertsondemandmenupage.html"> Our Food </a> </button> <br></br> <br></br> <button style="width:170px;height:35px;background-color:#87D163;" type="button" class="btn btn-default"> <a href="dessertsondemandorderform.html"> Order Form</a> </button> </a> <br></br> <br></br> <button style="width:170px;height:35px;background-color:#87D163;" type="button" class="btn btn-default"> <a href="dessertsondemandcontactus.html"> Contact Us </a> </button> <br></br> </div> <div id="content" style="background-color:#ffffff ;height:789px;width:675px;float:left;"> <br></br> <center> <h1> Desserts On Demand </h1> <h3> Summer Catering Made Fun! </h3> <br></br> </center> <!--This is the start of the order form--> <h2>Order Form</h2> <h4>Send Us Your Order!</h4> <!-- form--> <h3 align="left"> Items/ food </h3> <? * * */ //*********************** error_reporting(E_ALL | E_STRICT | E_NOTICE); ini_set('display_errors', '1'); /*SET THIS RIGHT BELOW AS THE FORM RECIEVING EMAIL*/ $webmaster_email = "-----------@gmail.com"; /* This bit sets the URLs of the supporting pages. If you change the names of any of the pages, you will need to change the values here. */ $feedback_page = "dessertsondemandorderform.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html"; //***************** // Begin //***************** //***************** // if (!isset($_POST['btn'])) { DisplayPage(); exit(); } if ($_POST['btn'] == 'Submit') { /* This next bit loads the form field data into variables. If you add a form field, you will need to add it here. */ /* First section of variables are for the Items/Food */ $food1 = $_POST['food1'] ; $onefudgebrownie = $_POST['onefudgebrownie'] ; $food2 = $_POST['food2'] ; $fouritalianbiscotti = $_POST['fouritalianbiscotti'] ; $food3 = $_POST['food3'] ; $foursoftchewychocolatechipcookies = $_POST['foursoftchewychocolatechipcookies'] ; $food4 = $_POST['food4'] ; $fourcapecodcranberryoatmealcookies = $_POST['fourcapecodcranberryoatmealcookies']; $food5 = $_POST['food5'] ; $oneloafofartisanfrenchbread = $_POST['oneloafofartisanfrenchbread'] ; $food6 = $_POST['food6'] ; $sixkaiserdelirolls = $_POST['sixkaiserdelirolls'] ; $food7 = $_POST['food7'] ; $sixsofthamburgerrolls = $_POST['sixsofthamburgerrolls'] ; $food8 = $_POST['food8'] ; $sixfiveinchsubrolls = $_POST['sixfiveinchsubrolls'] ; $food9 = $_POST['food9'] ; $twelvetwoinchsliderrolls = $_POST['twelvetwoinchsliderrolls'] ; $food10 = $_POST['food10'] ; $foursnkickerdoodlecookies = $_POST['foursnkickerdoodlecookies'] ; $food11 = $_POST['food11'] ; $onecolossalcinnamonstickybun = $_POST['onecolossalcinnamonstickybun'] ; $food12 = $_POST['food12'] ; $onedeliciouswhoopiepie = $_POST['onedeliciouswhoopiepie'] ; $food13 = $_POST['food13'] ; $fourislandcoconutmacaroons = $_POST['fourislandcoconutmacaroons'] ; /* This second section of variables are for the Shipping/Customer Info*/ $shippinglastname = $_POST['shippinglastname'] ; $shippingfirstname = $_POST['shippingfirstname'] ; $telephonecell = $_POST['telephonecell'] ; $emailaddress = $_POST['emailaddress'] ; $breifdescript = $_POST['breifdescript'] ; // If the user tries to access this script directly, redirect them to the feedback form, if (!isset($_POST['email_address'])) { header( "Location: $dessertsondemand.html" ); } // If the form fields are empty, redirect to the error page. elseif (empty($email_address) || empty($comments)) { header( "Location: $error_page" ); } // If email injection is detected, redirect to the error page. elseif ( isInjected($email_address) ) { header( "Location: $error_page" ); } // If we passed all previous tests, send the email then redirect to the thank you page. else { mail( "$webmaster_email", "Feedback Form Results",$comments, "From: $email_address" ); header( "Location: $thankyou_page" ); } } //****************** echo "Unhandled button "; exit(); //****************** //****************** //****************** /* The following function checks for email injection. Specifically, it checks for carriage returns - typically used by spammers to inject a CC list. */ function isInjected($str) { $injections = array('(\n+)','(\r+)','(\t+)','(%0A+)', '(%0D+)','(%08+)','(%09+)'); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } function DisplayPage() { $code=<<<heredocs <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <table align="left"> <tr> <td> <input type="checkbox" name="food1" value="" /> 1 Fudge Brownie</td> <td><input style="color:#000000" type="number" name="onefudgebrownie" /> </td> </tr> <tr> <td> <input type="checkbox" name="food2" value="" /> 4 Italian Biscotti </td> <td><input style="color:#000000" type="number" name="fouritalianbiscotti" /> </td> </tr> <tr> <td> <input type="checkbox" name="food3" value="" /> 4 Soft & Chewy Chocolate Chip Cookies</td> <td><input style="color:#000000" type="number" name="foursoftchewychocolatechipcookies" /> </td> </tr> <tr> <td> <input type="checkbox" name="food4" value="" /> 4 Cape Cod Cranberry Oatmeal Cookies</td> <td><input style="color:#000000" type="number" name="fourcapecodcranberryoatmealcookies" /> </td> </tr> <tr> <td> <input type="checkbox" name="food5" value="" /> 1 Loaf of Artisan French Bread. </td> <td><input style="color:#000000" type="number" name="oneloafofartisanfrenchbread" /> </td> </tr> <tr> <td> <input type="checkbox" name="food6" value="" /> 6 Kaiser Deli Rolls </td> <td><input style="color:#000000" type="number" name="sixkaiserdelirolls" /> </td> </tr> <tr> <td> <input type="checkbox" name="food7" value="" /> 6 Soft Hamburger Rolls</td> <td><input style="color:#000000" type="number" name="sixsofthamburgerrolls"/> </td> </tr> <tr> <td> <input type="checkbox" name="food8" value=""/> 6 5 sub rolls</td> <td><input style="color:#000000" type="number" name="sixfiveinchsubrolls"/> </td> </tr> <tr> <td> <input type="checkbox" name="food9" value="" /> 12 2" slider rolls</td> <td><input style="color:#000000" type="number" name="twelvetwoinchsliderrolls"/> </td> </tr> <tr> <td> <input type="checkbox" name="food10" value="" /> 4 Snickerdoodle Cookies</td> <td><input style="color:#000000" type="number" name="foursnkickerdoodlecookies"/> </td> </tr> <tr> <td> <input type="checkbox" name="food11" value="" /> 1 Colossal Cinnamon Sticky Bun</td> <td><input style="color:#000000" type="number" name="onecolossalcinnamonstickybun"/> </td> </tr> <tr> <td> <input type="checkbox" name="food12" value="" /> 1 Delicious Whoopie Pie</td> <td><input style="color:#000000" type="number" name="onedeliciouswhoopiepie"/> </td> </tr> <tr> <td> <input type="checkbox" name="food13" value="" /> 4 island coconut macaroons</td> <td><input style="color:#000000" type="number" name="fourislandcoconutmacaroons"/> </td> </tr> <tr> <td>Comments/Special Requests:</td> <td> <textarea rows="10" cols="50" name="comments" style="color:#000000" ></textarea> </td> </tr> </table> <br></br> <!--Shipping info/Personal Info Table --> <h3 align="left"> Shipping Information </h3> <table align="left"> <tr> <td>Last Name:</td> <td> <input style="color:#000000" type="text" name="shippinglastname" value="" maxlength="15" /> </td> <td>First Name:</td> <td> <input style="color:#000000" type="text" name="shippingfirstname" value="" maxlength="10" /> </td> </tr> <td>Telephone/Cell.:</td> <td> <input style="color:#000000" type="text" name="telephonecell" value="" maxlength="100" /> </td> <td>Email Address:</td> <td> <input style="color:#000000" type="text" name="emailaddress" value="" maxlength="100" /> </td> </tr> <tr> <td>Brief description of location on the lake:</td> <td> <textarea rows="10" cols="50" name="breifdescript" style="color:#000000"> </textarea> </td> </tr> <!--SUBMIT BUTTON --> <tr> <td> </td> <td> <input type="submit" name='btn'value="Submit" style = " background-color:#87D163; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:6px; color: #fff; font-family: 'Oswald'; font-size: 20px; text-decoration: none; cursor: pointer; border:none; submit:hover { border: none; background:#000000; box-shadow: 0px 0px 1px #777; }" /> </td> </tr> <!--SUBMIT BUTTON end --> </table> </form> heredocs; echo $code; return; } </div> <div id="footer" style="background-color:#fdfdfd;height:125px;clear:both;text-align:center-left;"> <center> <p style="font-size:6px;"> <h4> Contact Us </h4> <strong>Address:</strong> Patrick & Maureen Brideau<br> 126 Pond Hill Rd, Barrington, NH 03825<br> <strong>Telephone:</strong> (603)-978-0417<br> <strong>E-mail:</strong> dessertsondemand1@gmail.com </p> </div> </center> </div> </body> </center> </html>
  3. Hello everyone. I am writing this order/feedback form using a php script. Every time i hit submit, the html page (that has the form inside) just reloads and does not perform the script could anyone give me some pointers in my code the form/php? I have made sure they are linked verbatim I am a nube so please forgive my inexperience Here is the form in the html , down below it is the corresponding php code for the form <form action="send_mail.php" method="post"> <table align="left"> <tr> <td> <input type="checkbox" name="food1" value="" /> 1 Fudge Brownie</td> <td><input style="color:#000000" type="number" name="onefudgebrownie" /> </td> </tr> <tr> <td> <input type="checkbox" name="food2" value="" /> 4 Italian Biscotti </td> <td><input style="color:#000000" type="number" name="fouritalianbiscotti" /> </td> </tr> <tr> <td> <input type="checkbox" name="food3" value="" /> 4 Soft & Chewy Chocolate Chip Cookies</td> <td><input style="color:#000000" type="number" name="foursoftchewychocolatechipcookies" /> </td> </tr> <tr> <td> <input type="checkbox" name="food4" value="" /> 4 Cape Cod Cranberry Oatmeal Cookies</td> <td><input style="color:#000000" type="number" name="fourcapecodcranberryoatmealcookies" /> </td> </tr> <tr> <td> <input type="checkbox" name="food5" value="" /> 1 Loaf of Artisan French Bread. </td> <td><input style="color:#000000" type="number" name="oneloafofartisanfrenchbread" /> </td> </tr> <tr> <td> <input type="checkbox" name="food6" value="" /> 6 Kaiser Deli Rolls </td> <td><input style="color:#000000" type="number" name="sixkaiserdelirolls" /> </td> </tr> <tr> <td> <input type="checkbox" name="food7" value="" /> 6 Soft Hamburger Rolls</td> <td><input style="color:#000000" type="number" name="sixsofthamburgerrolls"/> </td> </tr> <tr> <td> <input type="checkbox" name="food8" value=""/> 6 5 sub rolls</td> <td><input style="color:#000000" type="number" name="sixfiveinchsubrolls"/> </td> </tr> <tr> <td> <input type="checkbox" name="food9" value="" /> 12 2" slider rolls</td> <td><input style="color:#000000" type="number" name="twelvetwoinchsliderrolls"/> </td> </tr> <tr> <td> <input type="checkbox" name="food10" value="" /> 4 Snickerdoodle Cookies</td> <td><input style="color:#000000" type="number" name="foursnkickerdoodlecookies"/> </td> </tr> <tr> <td> <input type="checkbox" name="food11" value="" /> 1 Colossal Cinnamon Sticky Bun</td> <td><input style="color:#000000" type="number" name="onecolossalcinnamonstickybun"/> </td> </tr> <tr> <td> <input type="checkbox" name="food12" value="" /> 1 Delicious Whoopie Pie</td> <td><input style="color:#000000" type="number" name="onedeliciouswhoopiepie"/> </td> </tr> <tr> <td> <input type="checkbox" name="food13" value="" /> 4 island coconut macaroons</td> <td><input style="color:#000000" type="number" name="fourislandcoconutmacaroons"/> </td> </tr> <tr> <td>Comments/Special Requests:</td> <td> <textarea rows="10" cols="50" name="comments" style="color:#000000" ></textarea> </td> </tr> </table> <br></br> <!--Shipping info/Personal Info Table --> <h3 align="left"> Shipping Information </h3> <table align="left"> <tr> <td>Last Name:</td> <td> <input style="color:#000000" type="text" name="shippinglastname" value="" maxlength="15" /> </td> <td>First Name:</td> <td> <input style="color:#000000" type="text" name="shippingfirstname" value="" maxlength="10" /> </td> </tr> <td>Telephone/Cell.:</td> <td> <input style="color:#000000" type="text" name="telephonecell" value="" maxlength="100" /> </td> <td>Email Address:</td> <td> <input style="color:#000000" type="text" name="emailaddress" value="" maxlength="100" /> </td> </tr> <tr> <td>Brief description of location on the lake:</td> <td> <textarea rows="10" cols="50" name="breifdescript" style="color:#000000"> </textarea> </td> </tr> <!--SUBMIT BUTTON --> <tr> <td> </td> <td> <input type="submit" value="Submit" style= " background-color:#87D163; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius:6px; color: #fff; font-family: 'Oswald'; font-size: 20px; text-decoration: none; cursor: pointer; border:none; submit:hover { border: none; background:#000000; box-shadow: 0px 0px 1px #777; }" /> </td> </tr> <!--SUBMIT BUTTON end --> </table> </form> PHP code below; <?php /*SET THIS RIGHT BELOW AS THE FORM RECIEVING EMAIL*/ $webmaster_email = "__________@gmail.com"; /* This bit sets the URLs of the supporting pages. If you change the names of any of the pages, you will need to change the values here. */ $feedback_page = "feedback_form.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html"; /* This next bit loads the form field data into variables. If you add a form field, you will need to add it here. */ /* First section of variables are for the Items/Food */ $food1 = $_REQUEST['food1'] ; $onefudgebrownie = $_REQUEST['onefudgebrownie'] ; $food2 = $_REQUEST['food2'] ; $fouritalianbiscotti = $_REQUEST['fouritalianbiscotti'] ; $food3 = $_REQUEST['food3'] ; $foursoftchewychocolatechipcookies = $_REQUEST['foursoftchewychocolatechipcookies'] ; $food4 = $_REQUEST['food4'] ; $fourcapecodcranberryoatmealcookies = $_REQUEST['fourcapecodcranberryoatmealcookies'] ; $food5 = $_REQUEST['food5'] ; $oneloafofartisanfrenchbread = $_REQUEST['oneloafofartisanfrenchbread'] ; $food6 = $_REQUEST['food6'] ; $sixkaiserdelirolls = $_REQUEST['sixkaiserdelirolls'] ; $food7 = $_REQUEST['food7'] ; $sixsofthamburgerrolls = $_REQUEST['sixsofthamburgerrolls'] ; $food8 = $_REQUEST['food8'] ; $sixfiveinchsubrolls = $_REQUEST['sixfiveinchsubrolls'] ; $food9 = $_REQUEST['food9'] ; $twelvetwoinchsliderrolls = $_REQUEST['twelvetwoinchsliderrolls'] ; $food10 = $_REQUEST['food10'] ; $foursnkickerdoodlecookies = $_REQUEST['foursnkickerdoodlecookies'] ; $food11 = $_REQUEST['food11'] ; $onecolossalcinnamonstickybun = $_REQUEST['onecolossalcinnamonstickybun'] ; $food12 = $_REQUEST['food12'] ; $onedeliciouswhoopiepie = $_REQUEST['onedeliciouswhoopiepie'] ; $food13 = $_REQUEST['food13'] ; $fourislandcoconutmacaroons = $_REQUEST['fourislandcoconutmacaroons'] ; /* This second section of variables are for the Shipping/Customer Info*/ $shippinglastname = $_REQUEST['shippinglastname'] ; $shippingfirstname = $_REQUEST['shippingfirstname'] ; $telephonecell = $_REQUEST['telephonecell'] ; $emailaddress = $_REQUEST['emailaddress'] ; $breifdescript = $_REQUEST['breifdescript'] ; /* The following function checks for email injection. Specifically, it checks for carriage returns - typically used by spammers to inject a CC list. */ function isInjected($str) { $injections = array('(\n+)', '(\r+)', '(\t+)', '(%0A+)', '(%0D+)', '(%08+)', '(%09+)' ); $inject = join('|', $injections); $inject = "/$inject/i"; if(preg_match($inject,$str)) { return true; } else { return false; } } // If the user tries to access this script directly, redirect them to the feedback form, if (!isset($_REQUEST['email_address'])) { header( "Location: $feedback_page" ); } // If the form fields are empty, redirect to the error page. elseif (empty($email_address) || empty($comments)) { header( "Location: $error_page" ); } // If email injection is detected, redirect to the error page. elseif ( isInjected($email_address) ) { header( "Location: $error_page" ); } // If we passed all previous tests, send the email then redirect to the thank you page. else { mail( "$webmaster_email", "Feedback Form Results", $comments, "From: $email_address" ); header( "Location: $thankyou_page" ); } ?> dessertsondemandorderform.html
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.