Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'config.php';
- error_reporting (E_ALL ^ E_NOTICE);
- $post = (!empty($_POST)) ? true : false;
- if($post)
- {
- include 'functions.php';
- $firstName = stripslashes($_POST['firstName']);
- $lastName = stripslashes($_POST['lastName']);
- $email = trim($_POST['email']);
- $country = stripslashes($_POST['country']);
- $message = "";
- $message .= "First Name: ";
- $message .= $firstName;
- $message .= "\n";
- $message .= "Last Name: ";
- $message .= $lastName;
- $message .= "\n";
- $message .= "Email: ";
- $message .= $email;
- $message .= "\n";
- $message .= "Country ";
- $message .= $country;
- $error = '';
- // Check firstName
- if(!$firstName)
- {
- $error .= 'You forgot to enter your first name.<br />';
- }
- // Check lastName
- if(!$lastName)
- {
- $error .= 'You forgot to enter your last name.<br />';
- }
- // Check country
- if(!$country)
- {
- $error .= 'You forgot to enter your country.<br />';
- }
- // Check email
- if(!$email)
- {
- $error .= 'You forgot to enter your e-mail id.<br />';
- }
- if($email && !ValidateEmail($email))
- {
- $error .= 'Invalid E-mail id !!!<br />';
- }
- if(!$error)
- {
- $subject = 'Hi, '.$firstName. ' ' .$lastName. ' is interested in Ireland - In a new light';
- $mail = mail(WEBMASTER_EMAIL, $subject, $message,
- "From: ".$firstName." ".$lastName." <".$email.">\r\n"
- ."Reply-To: ".$email."\r\n"
- ."X-Mailer: PHP/" . phpversion());
- if($mail)
- {
- echo 'OK';
- }
- }
- else
- {
- echo '<div class="notification_error">'.$error.'</div>';
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement