Jump to content

sicawebd

Members
  • Posts

    8
  • Joined

  • Last visited

sicawebd's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. yeah that thought crossed my mind this morning. will ask him if i can. thanks for your help though
  2. Yes it is that file. i’ve tried it again this morning with the original form.php file i used (which is same as below) and its now coming up just a blank screen with no errors. <?php // This work is licensed under the MIT License - http://www.opensourc...mit-license.php // OPTIONS - PLEASE CONFIGURE THESE BEFORE USE! $yourEmail = "rsvp@claireanddane.com"; //$yourWebsite = "http://www.claireanddane.com"; //$thanksPage = 'thanks.html'; //$maxPoints = 4; // $error_msg = null;$result = null; function isBot() {$bots = array("Indy", "Blaiz", "Java", "libwww-perl", "Python", "OutfoxBot", "User-Agent", "PycURL", "AlphaServer", "T8Abot", "Syntryx", "WinHttp", "WebBandit", "nicebot"); $isBot = false;foreach ($bots as $bot)if (strpos($_SERVER['HTTP_USER_AGENT'], $bot) !== false)$isBot = true; if (empty($_SERVER['HTTP_USER_AGENT']) || $_SERVER['HTTP_USER_AGENT'] == " ")$isBot = true; exit("Bots not allowed.</p>");} if ($_SERVER['REQUEST_METHOD'] == "POST") {function clean($data) {$data = trim(stripslashes(strip_tags($data)));return $data;} $points = (int)0; $badwords = array("adult", "beastial", "bestial", "blowjob", "clit", "cum", "cunilingus", "cunillingus", "cunnilingus", "cunt", "ejaculate", "fag", "felatio", "fellatio", "fuck", "fuk", "fuks", "gangbang", "gangbanged", "gangbangs", "hotsex", "hardcode", "jism", "jiz", "orgasim", "orgasims", "orgasm", "orgasms", "phonesex", "phuk", "phuq", "porn", "pussies", "pussy", "spunk", "xxx", "viagra", "phentermine", "tramadol", "adipex", "advai", "alprazolam", "ambien", "ambian", "amoxicillin", "antivert", "blackjack", "backgammon", "texas", "holdem", "poker", "carisoprodol", "ciara", "ciprofloxacin", "debt", "dating", "porn", "link=", "voyeur");$exploits = array("content-type", "bcc:", "cc:", "document.cookie", "onclick", "onload", "javascript"); foreach ($badwords as $word)if (strpos($_POST['comments'], $word) !== false)$points += 2; foreach ($exploits as $exploit)if (strpos($_POST['comments'], $exploit) !== false)$points += 2; if (strpos($_POST['comments'], "http://") !== false || strpos($_POST['comments'], "www.") !== false)$points += 2;if (isset($_POST['nojs']))$points += 1;if (preg_match("/(<.*>)/i", $_POST['comments']))$points += 2;if (strlen($_POST['name']) < 3)$points += 1;if (strlen($_POST['comments']) < 15 || strlen($_POST['comments'] > 1500))$points += 2; foreach ($_POST as $key => $value)$_POST[$key] = trim($value); if (empty($_POST['name']) || empty($_POST['email']) || empty($_POST['comments'])) {$error_msg .= "Name, e-mail and comments are required fields. \n";} elseif (strlen($_POST['name']) > 15) {$error_msg .= "The name field is limited at 15 characters. Your first name or nickname will do! \n";} elseif (!preg_match("/^[a-zA-Z-'\s]*$/", stripslashes($_POST['name']))) {$error_msg .= "The name field must not contain special characters. \n";} elseif (!preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($_POST['email']))) {$error_msg .= "That is not a valid e-mail address. \n";} elseif (!empty($_POST['url']) && !preg_match('/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(\d+))?\/?/i', $_POST['url']))$error_msg .= "Invalid website url."; if ($error_msg == NULL && $points <= $maxPoints) {$subject = "Automatic Form Email"; $message = "You received this e-mail message through your website: \n\n";foreach ($_POST as $key => $val) {$message .= ucwords($key) . ": " . clean($val) . "\r\n";}$message .= 'IP: '.$_SERVER['REMOTE_ADDR']."\r\n";$message .= 'Browser: '.$_SERVER['HTTP_USER_AGENT']."\r\n";$message .= 'Points: '.$points; if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) {$headers = "From: $yourEmail \r\n";$headers .= "Reply-To: {$_POST['email']}";} else {$headers = "From: $yourWebsite <$yourEmail> \r\n";$headers .= "Reply-To: {$_POST['email']}";} if (mail($yourEmail,$subject,$message,$headers)) {if (!empty($thanksPage)) {header("Location: $thanksPage");exit;} else {$result = 'Your mail was successfully sent.';}} else {$error_msg = 'Your mail could not be sent this time.';}} else {if (empty($error_msg))$error_msg = 'Your mail looks too much like spam, and could not be sent this time. ['.$points.']';}}function get_data($var) {if (isset($_POST[$var]))echo htmlspecialchars($_POST[$var]);}?>
  3. It still came up error at line 22. If i do the var_dump where do i put this code?
  4. Yes still at line 22. Ah sorry i’m a complete beginner with php so not sure what you mean by var_dump. could you please put in steps what i need to do? Thanks
  5. Ok thanks for the quick reply. I’ve updated this region but its still coming up an error. Any idea as to where from here? Jessica
  6. The error refers to: if (strpos($_SERVER['HTTP_USER_AGENT'], $bot) !== false) also where should be curly braces be used?
  7. Hi, Ive recently started up my own small business doing web design for personal wedding invites. Im still quite new at everything, however now that i’ve got my first website invite up and running the contact form doesnt seem to work, i got this form from a tutorial I did when i was first started learning dreamweaver so i cant pick up where i’ve gone wrong. When i click send it comes up with a white screen with the error "Parse error: syntax error, unexpected T_STRING in /home/content/43/10414143/html/form.php on line 22" html is as follows: <div id="rsvp-form-2"> <form class="required-form" action="form.php" method="post"><ol class="forms"> <li><label for="rsvp">Yes / No</label><input type="text" name="rsvp" id="name" /></li> <li><label for="name">Name</label><input type="text" name="name" id="name" /></li> <li><label for="name">Guest Name</label><input type="text" name="name" id="name" /></li> <li><label for="email">Email</label><input type="text" name="email" id="email" /></li> <li><label for="phone">Phone</label><input type="text" name="phone" id="phone" /></li> <li><label for="message">Message</label><textarea name="message" id="message"></textarea></li> <li class="buttons"><button type="submit" style="background: none; border: 0px;"><img src="Images/RSVP/send.gif" /></button></li> <li class="buttons submit"><input type="submit" value="submit" /></li> <li class="buttons reset"><input type="reset" value="reset" /></li> </ol> </form> </div> I also have a validate.js and css with the following script in my header: <script type="text/javascript"> $(document).ready(function() { $('form.required-form').simpleValidate({ errorElement: 'em' }); }); </script> and php is as follows: <?php // This work is licensed under the MIT License - http://www.opensource.org/licenses/mit-license.php // OPTIONS - PLEASE CONFIGURE THESE BEFORE USE! $yourEmail = "rsvp@claireanddane.com"; // $yourWebsite = "http://www.claireanddane.com"; // $thanksPage = 'thanks.html'; // $maxPoints = 4; // $error_msg = null; $result = null; function isBot() { $bots = array("Indy", "Blaiz", "Java", "libwww-perl", "Python", "OutfoxBot", "User-Agent", "PycURL", "AlphaServer", "T8Abot", "Syntryx", "WinHttp", "WebBandit", "nicebot"); $isBot = false; foreach ($bots as $bot) if (strpos($_SERVER['HTTP_USER_AGENT'], $bot) !== false) $isBot = true; if (empty($_SERVER['HTTP_USER_AGENT']) || $_SERVER['HTTP_USER_AGENT'] == " ") $isBot = true; exit("Bots not allowed.</p>"); } if ($_SERVER['REQUEST_METHOD'] == "POST") { function clean($data) { $data = trim(stripslashes(strip_tags($data))); return $data; } $points = (int)0; $badwords = array("adult", "beastial", "bestial", "blowjob", "clit", "cum", "cunilingus", "cunillingus", "cunnilingus", "cunt", "ejaculate", "fag", "felatio", "fellatio", "fuck", "fuk", "fuks", "gangbang", "gangbanged", "gangbangs", "hotsex", "hardcode", "jism", "jiz", "orgasim", "orgasims", "orgasm", "orgasms", "phonesex", "phuk", "phuq", "porn", "pussies", "pussy", "spunk", "xxx", "viagra", "phentermine", "tramadol", "adipex", "advai", "alprazolam", "ambien", "ambian", "amoxicillin", "antivert", "blackjack", "backgammon", "texas", "holdem", "poker", "carisoprodol", "ciara", "ciprofloxacin", "debt", "dating", "porn", "link=", "voyeur"); $exploits = array("content-type", "bcc:", "cc:", "document.cookie", "onclick", "onload", "javascript"); foreach ($badwords as $word) if (strpos($_POST['comments'], $word) !== false) $points += 2; foreach ($exploits as $exploit) if (strpos($_POST['comments'], $exploit) !== false) $points += 2; if (strpos($_POST['comments'], "http://") !== false || strpos($_POST['comments'], "www.") !== false) $points += 2; if (isset($_POST['nojs'])) $points += 1; if (preg_match("/(<.*>)/i", $_POST['comments'])) $points += 2; if (strlen($_POST['name']) < 3) $points += 1; if (strlen($_POST['comments']) < 15 || strlen($_POST['comments'] > 1500)) $points += 2; foreach ($_POST as $key => $value) $_POST[$key] = trim($value); if (empty($_POST['name']) || empty($_POST['email']) || empty($_POST['comments'])) { $error_msg .= "Name, e-mail and comments are required fields. \n"; } elseif (strlen($_POST['name']) > 15) { $error_msg .= "The name field is limited at 15 characters. Your first name or nickname will do! \n"; } elseif (!preg_match("/^[a-zA-Z-'\s]*$/", stripslashes($_POST['name']))) { $error_msg .= "The name field must not contain special characters. \n"; } elseif (!preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($_POST['email']))) { $error_msg .= "That is not a valid e-mail address. \n"; } elseif (!empty($_POST['url']) && !preg_match('/^(http|https):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(\d+))?\/?/i', $_POST['url'])) $error_msg .= "Invalid website url."; if ($error_msg == NULL && $points <= $maxPoints) { $subject = "Automatic Form Email"; $message = "You received this e-mail message through your website: \n\n"; foreach ($_POST as $key => $val) { $message .= ucwords($key) . ": " . clean($val) . "\r\n"; } $message .= 'IP: '.$_SERVER['REMOTE_ADDR']."\r\n"; $message .= 'Browser: '.$_SERVER['HTTP_USER_AGENT']."\r\n"; $message .= 'Points: '.$points; if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) { $headers = "From: $yourEmail \r\n"; $headers .= "Reply-To: {$_POST['email']}"; } else { $headers = "From: $yourWebsite <$yourEmail> \r\n"; $headers .= "Reply-To: {$_POST['email']}"; } if (mail($yourEmail,$subject,$message,$headers)) { if (!empty($thanksPage)) { header("Location: $thanksPage"); exit; } else { $result = 'Your mail was successfully sent.'; } } else { $error_msg = 'Your mail could not be sent this time.'; } } else { if (empty($error_msg)) $error_msg = 'Your mail looks too much like spam, and could not be sent this time. ['.$points.']'; } } function get_data($var) { if (isset($_POST[$var])) echo htmlspecialchars($_POST[$var]); } ?> website for reference is http://www.claireanddane.com Any advice would be appreciated as i’ve tried everything! Jessica
×
×
  • 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.