Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $event_date = $_POST['event_date'];
- $name = $_POST['full_name'];
- $event_type = $_POST['event_type'];
- $telephone = $_POST['telephone'];
- $email = $_POST['email'];
- $email_from = 'mywebsiteemail@gmail.com';
- $email_subject = "New Form submission from your website";
- $email_body = "You have received a new message via your websites form from $name.\n".
- "The date requested for the event is:\n $event_date\n".
- "The type of event is:\n $event_type \n".
- "The customers contact telephone number is:\n $telephone \n".
- "From:\n $email \n".
- $to = "myclientsemail@gmail.com";
- $headers = "From: $email_from \r\n";
- $headers = "Reply-To: $email \r\n";
- mail($to,$email_subject,$email_body,$headers);
- //Load thank you page once form is submitted
- header ('Location: contact-thank-you.html');
- exit();
- ?>
- <?php
- 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(IsInjected($visitor_email))
- {
- echo "Bad email value!";
- exit;
- }
- error_reporting(-1);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement