perryc Posted July 23, 2010 Report Share Posted July 23, 2010 Hello, i was wondering if someone could help me troubleshoot my contact form for my website. My php is not showing up right with it? I will be working on it today and tommrow, so i was wondering if someone could help me trouble shoot this problem. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 23, 2010 Report Share Posted July 23, 2010 Can you post the code you are working with? And specifically, what issues are you having? Quote Link to comment Share on other sites More sharing options...
perryc Posted July 23, 2010 Author Report Share Posted July 23, 2010 Can you post the code you are working with? And specifically, what issues are you having? <?php if (array_key_exists('send', $_POST)) { // mail processing script // remove escape characters from POST array if (PHP_VERSION < 6 && get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); } $to = 'codyperry65@yahoo.com'; // use your own email adress $subject = 'Legend of Drizzt Feedback Message'; // list expected fields $expected = array('first_name', 'last_name', 'email', 'comments'); // set required fields $required = array('first_name', 'last_name', 'email', 'comments'); // create empty array for missing fields $missing = array(); // process the $_POST variables foreach ($_POST as $key => $value) { // assign to temporary variable and strip whitespace if not an array $temp = is_array($value) ? $value : trim($value); // if empty and required, add to $missing array if (empty($temp) && in_array($key, $required)) { array_push($missing, $key); } elseif (in_array($key, $expected)) { // otherwise, assign to a variable of the same name as $key ${$key} = $temp; } // build the messege $messege = "First Name: $first_name\r\n\r\n"; $messege = "Last Name: $last_name\r\n\r\n"; $messege .= "Email: $email\r\n\r\n"; $messege .= "Comments: $comments"; // limit line length to 70 characters $messege = wordwrap($messege, 150); // send it $mailSent = mail($to, $subject, $message); } ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Legend of Drizzt - Contact</title> <link href="legendofdrizzt.css" rel="stylesheet" type="text/css" /><!--[if IE 5]> <style type="text/css"> /* place css box model fixes for IE 5* in this conditional comment */ .twoColFixLtHdr #sidebar1 { width: 230px; } </style> <![endif]--><!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ .twoColFixLtHdr #sidebar1 { padding-top: 30px; } .twoColFixLtHdr #mainContent { zoom: 1; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } //--> </script> <style type="text/css"> <!-- a:link { color: #00F; text-decoration: none; } a:visited { color: #906; text-decoration: none; } a:hover { color: #96F; text-decoration: none; } a:active { color: #600; text-decoration: none; } .twoColFixLtHdr #container #mainContent #form1 table tr td strong { text-align: center; } .twoColFixLtHdr #container #mainContent #form1 table { text-align: left; } .twoColFixLtHdr #container #mainContent #form1 table tr td { font-weight: bold; } --> </style> </head> <body class="twoColFixLtHdr"> <yah> <div id="container"> <div id="header"> <h1> </h1> <!-- end #header --> </div> <div class="navbar" id="navbar"></div> <div id="sidebar1"> <ul id="MenuBar1" class="MenuBarVertical"> <li><a href="index.php">Home</a> </li> <li><a href="characters.php">Characters</a></li> <li><a href="#">My Account</a></li> <li><a href="#">Forums</a></li> <li><a href="#">Books</a></li> <li><a href="#">About</a></li> <li><a href="#">Contact</a></li> </ul> <h3> </h3> <!-- end #sidebar1 --></div> <div id="mainContent"> <h1>Contact Form</h1> <?php if ($_POST && !$mailSent) { ?> <p class="warning">Sorry, there was a problem sending your message. Please try again.</p> <?php } elseif ($_POST && $mailSent) { ?> <p><strong>Your message has been sent. Thank you for your feedback. </strong></p> <?php } ?> <form id="contact" name="form1" method="post" action=""> <table width="517" border="0" cellpadding="3" cellspacing="10"> <tr> <th width="212" scope="col">First Name:</th> <th width="263" scope="col"><label for="first_name"></label> <input name="first_name" type="text" id="first_name" size="35" maxlength="30" /></th> </tr> <tr> <td><strong>Last Name:</strong></td> <td><label for="last_name"></label> <input name="last_name" type="text" id="last_name" size="35" maxlength="30" /></td> </tr> <tr> <td>Email Address:</td> <td><label for="email"></label> <input name="email" type="text" id="email" size="35" /></td> </tr> <tr> <td><p> </p> <p>I Want to Help With: </p> <p>(optional)</p></td> <td><p> <label> <input type="checkbox" name="interests[]" value="Advertising" id="interests_0" /> Advertising </label> <br /> <label> <input type="checkbox" name="interests[]" value="Programming" id="interests_1" /> Programming </label> <br /> <label> <input type="checkbox" name="interests[]" value="Designing" id="interests_2" /> Designing </label> <br /> </p></td> </tr> <tr> <td><p>Additional Comments:</p></td> <td><p><br /> <label for="comments"></label> <textarea name="comments" id="comments" cols="30" rows="5"></textarea> <br /> </p></td> </tr> <tr align="center"> <td colspan="2"><input type="submit" name="submit" id="submit" value="submit" /></td> </tr> </table> <p><!-- end #mainContent --> </p> </form> </div> <div id="footer"> <!-- end #footer -->Legend of Drizzt © 2010</div> <!-- end #container --></div> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html> Quote Link to comment Share on other sites More sharing options...
perryc Posted July 23, 2010 Author Report Share Posted July 23, 2010 Its not completely finished but i keep getting my code above my header image when i insert it under my code under the // process the $_POST variables comment. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
perryc Posted July 23, 2010 Author Report Share Posted July 23, 2010 But if i keep it this way it shows up right besides the warning messages right now. Could it be because im not viewing it on a server. // process the $_POST variables $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $comments = $_POST['comments']; thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 23, 2010 Report Share Posted July 23, 2010 When you are looking at this contact form on your computer, do you have a server set up on it (I usually suggest WAMP for Windows users and MAMP for Mac users)? PHP requires a server to work, so the PHP code will show up if you aren't using something like that. If not, either you'll need to set up one of those programs on your computer, or upload to your server and do your testing there. Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 Heres the link to the page on the server. I keep getting a Parse error: syntax error, unexpected T_VARIABLE in /home/legendo3/public_html/contact.php on line 100 http://www.legendofdrizzt.com/contact.php Here is my code for the final contact form. <?php if (array_key_exists('send', $_POST)) { // mail processing script // remove escape characters from POST array if (PHP_VERSION < 6 && get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); } $to = 'codyperry65@yahoo.com'; // use your own email adress $subject = 'Legend of Drizzt Feedback Message'; // list expected fields $expected = array('first_name', 'last_name', 'email', 'comments', 'interests'); // set required fields $required = array('first_name', 'last_name', 'email', 'comments'); // create empty array for missing fields $missing = array(); // set default values for variables that might not exist if (!isset($_POST['interests'])) { $_POST['interests'] = array(); } // assume that there is nothing suspect $suspect = false; // create a pattern to locate suspect phrases $pattern = '/Content-Type:|Bcc:|Cc:/i'; // function to check for suspect phrases function isSuspect($val, $pattern, &$suspect) { // if the variable is an array, loop through each element // and pass it recursively back to the same function if (is_array($val)) { foreach ($val as $item) { isSuspect($item, $pattern, $suspect); } } else { // if one of the suspect phrases is found, set Boolean to true if (preg_match($pattern, $val)) { $suspect = true; } } } if ($suspect) { $mailSent = flase; unset($missing); } else { // process the $_POST variables $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $comments = $_POST['comments']; } // validate the email address if (!$empty($email)) { // regex to identify illegal characters in email address $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/'; // reject the email address if it doesn't match if (!preg_match($checkEmail, $email)) { $suspect = true; $mailSent = flase; unset($missing); } } // go ahead only if not suspect all required fields OK if (!$suspect && empty($missing)) { // build the messege $messege = "First Name: $first_name\r\n\r\n"; $messege = "Last Name: $last_name\r\n\r\n"; $messege .= "Email: $email\r\n\r\n"; $messege .= "Comments: $comments\r\n\r\n"; $messege .= 'Interests: '.implode(',', $interests); // limit line length to 150 characters $messege = wordwrap($messege, 150); // create additional headers $headers = "From: Feedback from Legend of Drizzt Website<codyperry65@yahoo.com>\r\n"; $headers .= 'Content-Type: text/plain; charset=utf-8'; $headers .= 'Cc: codyperry65@yahoo.com'; if (!empty($email)) { $headers .= "\r\nReply-To: $email"; } // send it ini_set('sendmail_from', 'codyperry65@yahoo.com' $mailSent = mail($to, $subject, $message, $headers); if ($mailSent) { // missing is no longer needed if the email is sent, so unset it unset($missing); // redirect the page with a fully qualified URL header('Location: http://www.legendofdrizzt.com/index.php''>http://www.legendofdrizzt.com/index.php'); exit; } } } ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Legend of Drizzt - Contact</title> <link href="../Users/codyperry/Desktop/legendofdrizzt/legendofdrizzt.css" rel="stylesheet" type="text/css" /><!--[if IE 5]> <style type="text/css"> /* place css box model fixes for IE 5* in this conditional comment */ .twoColFixLtHdr #sidebar1 { width: 230px; } </style> <![endif]--><!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ .twoColFixLtHdr #sidebar1 { padding-top: 30px; } .twoColFixLtHdr #mainContent { zoom: 1; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <script src="../Users/codyperry/Desktop/legendofdrizzt/SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="../Users/codyperry/Desktop/legendofdrizzt/SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } //--> </script> <style type="text/css"> <!-- a:link { color: #00F; text-decoration: none; } a:visited { color: #906; text-decoration: none; } a:hover { color: #96F; text-decoration: none; } a:active { color: #600; text-decoration: none; } .twoColFixLtHdr #container #mainContent #form1 table tr td strong { text-align: center; } .twoColFixLtHdr #container #mainContent #form1 table { text-align: left; } .twoColFixLtHdr #container #mainContent #form1 table tr td { font-weight: bold; } --> </style> </head> <body class="twoColFixLtHdr"> <yah> <div id="container"> <div id="header"> <h1> </h1> <!-- end #header --> </div> <div class="navbar" id="navbar"></div> <div id="sidebar1"> <ul id="MenuBar1" class="MenuBarVertical"> <li><a href="../Users/codyperry/Desktop/legendofdrizzt/index.php">Home</a> </li> <li><a href="../Users/codyperry/Desktop/legendofdrizzt/characters.php">Characters</a></li> <li><a href="../Users/codyperry/Desktop/legendofdrizzt/account.php">My Account</a></li> <li><a href="../Users/codyperry/Desktop/legendofdrizzt/forum.php">Forums</a></li> <li><a href="../Users/codyperry/Desktop/legendofdrizzt/books.php">Books</a></li> <li><a href="../Users/codyperry/Desktop/legendofdrizzt/about.php">About</a></li> <li><a href="../Users/codyperry/Desktop/legendofdrizzt/contact.php">Contact</a></li> </ul> <h3> </h3> <!-- end #sidebar1 --></div> <div id="mainContent"> <h1>Contact Form</h1> <?php if ($_POST && isset($missing) && !empty($missing)) { ?> <?php } elseif ($_POST && !$mailSent) { ?> <?php } elseif ($_POST && $mailSent) { ?> <?php } ?> <form id="contact" name="form1" method="post" action=""> <table width="517" border="0" cellpadding="3" cellspacing="10"> <tr> <th width="212" scope="col"><span class="warning">*</span> First Name:</th> <th width="263" scope="col"><label for="first_name"> <?php if (isset($missing) && in_array('first_name', $missing)) { ?> </label> <input name="first_name" type="text" id="first_name" size="35" maxlength="30" /></th> </tr> <tr> <td><strong> <span class="warning">*</span> Last Name:</strong></td> <td><label for="last_name"> <?php if (isset($missing) && in_array('last_name', $missing)) { ?> </label> <input name="last_name" type="text" id="last_name" size="35" maxlength="30" /></td> </tr> <tr> <td><span class="warning">*</span> Email Address:</td> <td><label for="email"> <?php if (isset($missing) && in_array('email', $missing)) { ?></label> <input name="email" type="text" id="email" size="35" /></td> </tr> <tr> <td><p> </p> <p>I Want to Help With: </p> <p>(optional)</p></td> <td><p> <label> <input type="checkbox" name="interests[]" value="Advertising" id="interests_0" /> Advertising </label> <br /> <label> <input type="checkbox" name="interests[]" value="Programming" id="interests_1" /> Programming </label> <br /> <label> <input type="checkbox" name="interests[]" value="Designing" id="interests_2" /> Designing </label> <br /> </p></td> </tr> <tr> <td><p>Additional Comments:</p></td> <td><p><br /> <label for="comments"></label> <textarea name="comments" id="comments" cols="30" rows="5"></textarea> <br /> </p></td> </tr> <tr align="center"> <td colspan="2"><input type="submit" name="submit" id="submit" value="submit" /></td> </tr> </table> <p><!-- end #mainContent --> </p> </form> </div> <div id="footer"> <!-- end #footer -->Legend of Drizzt © 2010</div> <!-- end #container --></div> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html> this is the area of the code thats causing a problem. // send it ini_set('sendmail_from', 'codyperry65@yahoo.com' $mailSent = mail($to, $subject, $message, $headers); if ($mailSent) { // missing is no longer needed if the email is sent, so unset it unset($missing); // redirect the page with a fully qualified URL header('Location: http://www.legendofdrizzt.com/index.php'); exit; } This is the line 100: $mailSent = mail($to, $subject, $message, $headers); if somebody could help that would be great. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 Now i have a $end error after i deleted a line of code under the //send it comment. If you guys could look over the code there, its the complete form and see if theres a bracket or semi-colon or something missing. That would be very helpful. Anything im missing let me know. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
Wickham Posted July 24, 2010 Report Share Posted July 24, 2010 This line // send it ini_set('sendmail_from', 'codyperry65@yahoo.com' certainly looks unfinished. There's a ) missing and also a missing ; at the end but my PHP isn't very good. Try // send it ini_set('sendmail_from', 'codyperry65@yahoo.com'); Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 24, 2010 Report Share Posted July 24, 2010 Your "ini_set('sendmail_from', 'codyperry65@yahoo.com'" is missing a closing ");". EDIT: Wickham got to it first... Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 im still getting the $end error on my website, when i go to display it. Any clue what it might be. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 24, 2010 Report Share Posted July 24, 2010 Near the end of your code, in the HTML section, you have several php if statements with opening "{" that never have an associated closing "}". For example: <?php if (isset($missing) && in_array('first_name', $missing)) { ?> Somewhere in your code, you'd need a closing "<?php } ?>" (for each PHP statement that needs a closing bracket -- it looks like you have at least 3.) Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 Not sure quite what you mean? Could you explain it more, im working off of a school assignment i did, so it has the same stuff like where exactly in my code did you see i need that examples from my code and what it should look like would be great. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 24, 2010 Report Share Posted July 24, 2010 The PHP statements I am talking about are in this block of code: <form id="contact" name="form1" method="post" action=""> <table width="517" border="0" cellpadding="3" cellspacing="10"> <tr> <th width="212" scope="col"><span class="warning">*</span> First Name:</th> <th width="263" scope="col"><label for="first_name"> <?php if (isset($missing) && in_array('first_name', $missing)) { ?> </label> <input name="first_name" type="text" id="first_name" size="35" maxlength="30" /></th> </tr> <tr> <td><strong> <span class="warning">*</span> Last Name:</strong></td> <td><label for="last_name"> <?php if (isset($missing) && in_array('last_name', $missing)) { ?> </label> <input name="last_name" type="text" id="last_name" size="35" maxlength="30" /></td> </tr> <tr> <td><span class="warning">*</span> Email Address:</td> <td><label for="email"> <?php if (isset($missing) && in_array('email', $missing)) { ?></label> <input name="email" type="text" id="email" size="35" /></td> </tr> <tr> <td><p> </p> <p>I Want to Help With: </p> I'm not really sure what their purpose is... No matter how it's intended to be used, each opening { needs a closing }. Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 Ya i got it to display now it just does not send the email right or anything, now i know why i hate php. thanks, haseo15 Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 24, 2010 Report Share Posted July 24, 2010 Can you be specific: "it just does not send the email right or anything" Quote Link to comment Share on other sites More sharing options...
Wickham Posted July 24, 2010 Report Share Posted July 24, 2010 Even if you have WAMP or XAMP server on your computer you can't send emails from the local page without an additional email server!! Upload to your host and test emails for real from the online version. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 24, 2010 Report Share Posted July 24, 2010 One quick thing I noticed when going over your code... you have a couple instances of $mailSent = flase; Shouldn't that be "false"? That may be messing up your validation and causing the form to submit when it shouldn't. Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 I fixed the false statements you said and got the $end error again the only other thing i added was <?php echo $_SERVER['PHP_SELF'] ?> to the action property of the form. Still trying to get it right thanks for the help as well kind of stuck not sure whats causing problems. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 i am testing it from my server now. http://legendofdrizzt.com/contact.php Thanks, haseo15 Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 24, 2010 Report Share Posted July 24, 2010 That's usually an indication that you are missing a "}" somewhere. Post the code you are working with, since I'm sure it's changed since the last bit of code you posted. Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 Heres the code <?php if (array_key_exists('send', $_POST)) { // mail processing script // remove escape characters from POST array if (PHP_VERSION < 6 && get_magic_quotes_gpc()) { function stripslashes_deep($value) { $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value); return $value; } $_POST = array_map('stripslashes_deep', $_POST); } $to = 'codyperry65@yahoo.com'; // use your own email adress $subject = 'Legend of Drizzt Feedback Message'; // list expected fields $expected = array('first_name', 'last_name', 'email', 'comments', 'interests'); // set required fields $required = array('first_name', 'last_name', 'email', 'comments'); // create empty array for missing fields $missing = array(); // set default values for variables that might not exist if (!isset($_POST['interests'])) { $_POST['interests'] = array(); } // assume that there is nothing suspect $suspect = false; // create a pattern to locate suspect phrases $pattern = '/Content-Type:|Bcc:|Cc:/i'; // function to check for suspect phrases function isSuspect($val, $pattern, &$suspect) { // if the variable is an array, loop through each element // and pass it recursively back to the same function if (is_array($val)) { foreach ($val as $item) { isSuspect($item, $pattern, $suspect); } } else { // if one of the suspect phrases is found, set Boolean to true if (preg_match($pattern, $val)) { $suspect = true; } } } if ($suspect) { $mailSent = false; unset($missing); } else { // process the $_POST variables $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $comments = $_POST['comments']; } // validate the email address if (!$empty($email)) { // regex to identify illegal characters in email address $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/'; // reject the email address if it doesn't match if (!preg_match($checkEmail, $email)) { $suspect = true; $mailSent = false; unset($missing); } } // go ahead only if not suspect all required fields OK if (!$suspect && empty($missing)) { // build the messege $messege = "First Name: $first_name\r\n\r\n"; $messege = "Last Name: $last_name\r\n\r\n"; $messege .= "Email: $email\r\n\r\n"; $messege .= "Comments: $comments\r\n\r\n"; $messege .= 'Interests: '.implode(',', $interests); // limit line length to 150 characters $messege = wordwrap($messege, 150); // create additional headers $headers = "From: Feedback from Legend of Drizzt Website<codyperry65@yahoo.com>\r\n"; $headers .= 'Content-Type: text/plain; charset=utf-8'; $headers .= 'Cc: codyperry65@yahoo.com'; if (!empty($email)) { $headers .= "\r\nReply-To: $email"; } // send it ini_set('sendmail_from', 'codyperry65@yahoo.com'); $mailSent = mail($to, $subject, $message, $headers, '-codyperry65@yahoo.com'); if ($mailSent) { // missing is no longer needed if the email is sent, so unset it unset($missing); } } } ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Legend of Drizzt - Contact</title> <link href="legendofdrizzt.css" rel="stylesheet" type="text/css" /><!--[if IE 5]> <style type="text/css"> /* place css box model fixes for IE 5* in this conditional comment */ .twoColFixLtHdr #sidebar1 { width: 230px; } </style> <![endif]--><!--[if IE]> <style type="text/css"> /* place css fixes for all versions of IE in this conditional comment */ .twoColFixLtHdr #sidebar1 { padding-top: 30px; } .twoColFixLtHdr #mainContent { zoom: 1; } /* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */ </style> <![endif]--> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script> <link href="SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } //--> </script> <style type="text/css"> <!-- a:link { color: #00F; text-decoration: none; } a:visited { color: #906; text-decoration: none; } a:hover { color: #96F; text-decoration: none; } a:active { color: #600; text-decoration: none; } .twoColFixLtHdr #container #mainContent #form1 table tr td strong { text-align: center; } .twoColFixLtHdr #container #mainContent #form1 table { text-align: left; } .twoColFixLtHdr #container #mainContent #form1 table tr td { font-weight: bold; } --> </style> </head> <body class="twoColFixLtHdr"> <yah> <div id="container"><img src="images/legendofdrizzt05.jpg" alt="Header image for the legend of drizzt website" width="837" height="108" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="rect" coords="8,3,842,176" href="index.php" /> </map> <div class="navbar" id="navbar"></div> <div id="sidebar1"> <ul id="MenuBar1" class="MenuBarVertical"> <li><a href="index.php">Home</a> </li> <li><a href="characters.php">Characters</a></li> <li><a href="account.php">My Account</a></li> <li><a href="forum.php">Forums</a></li> <li><a href="books.php">Books</a></li> <li><a href="about.php">About</a></li> <li><a href="contact.php">Contact</a></li> </ul> <h3> </h3> <!-- end #sidebar1 --></div> <div id="mainContent"> <h1>Contact Form</h1> <?php if ($_POST && isset($missing) && !empty($missing)) { ?> <?php } elseif ($_POST && !$mailSent) { ?> <?php } elseif ($_POST && $mailSent) { ?> <form id="contact" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>"> <table width="517" border="0" cellpadding="3" cellspacing="10"> <tr> <th width="212" scope="col"><span class="warning">*</span> First Name:</th> <th width="263" scope="col"><label for="first_name"> <?php if (isset($missing) && in_array('first_name', $missing)) { } ?> </label> <input name="first_name" type="text" id="first_name" size="35" maxlength="30" /></th> </tr> <tr> <td><strong> <span class="warning">*</span> Last Name:</strong></td> <td><label for="last_name"> <?php if (isset($missing) && in_array('last_name', $missing)) { }?> </label> <input name="last_name" type="text" id="last_name" size="35" maxlength="30" /></td> </tr> <tr> <td><span class="warning">*</span> Email Address:</td> <td><label for="email"> <?php if (isset($missing) && in_array('email', $missing)) { } ?></label> <input name="email" type="text" id="email" size="35" /></td> </tr> <tr> <td><p> </p> <p>I Want to Help With: </p> <p>(optional)</p></td> <td><p> <label> <input type="checkbox" name="interests[]" value="Advertising" id="interests_0" /> Advertising </label> <br /> <label> <input type="checkbox" name="interests[]" value="Programming" id="interests_1" /> Programming </label> <br /> <label> <input type="checkbox" name="interests[]" value="Designing" id="interests_2" /> Designing </label> <br /> </p></td> </tr> <tr> <td><p>Additional Comments:</p></td> <td><p><br /> <label for="comments"></label> <textarea name="comments" id="comments" cols="30" rows="5"></textarea> <br /> </p></td> </tr> <tr align="center"> <td colspan="2"><input type="submit" name="submit" id="submit" value="submit" /></td> </tr> </table> <p><!-- end #mainContent --> </p> </form> </div> <div id="footer"> <!-- end #footer -->Legend of Drizzt © 2010</div> <!-- end #container --></div> <script type="text/javascript"> <!-- var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif"}); //--> </script> </body> </html> Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 24, 2010 Report Share Posted July 24, 2010 Looks like you are missing a <?php } ?> after <?php } elseif ($_POST && $mailSent) { ?> (near the end of the file) Quote Link to comment Share on other sites More sharing options...
perryc Posted July 24, 2010 Author Report Share Posted July 24, 2010 Got it to display again, just can't get it to send the email to me. plus the required fields will not work for some reason. The required ones are first_name, last_name, and email. Thanks, Cody Perry Quote Link to comment Share on other sites More sharing options...
falkencreative Posted July 25, 2010 Report Share Posted July 25, 2010 Check your private messages. 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.
Note: Your post will require moderator approval before it will be visible.