Please enter your first name!

'; } // Check for a last name. if (eregi ('^[[:alpha:]\.\' \-]{2,30}$', stripslashes(trim($_POST['last_name'])))) { $ln = ($_POST['last_name']); } else { $ln = FALSE; echo '

Please enter your last name!

'; } // Check for an email address. if (eregi ('^[[:alnum:]][a-z0-9_\.\-]*@[a-z0-9\.\-]+\.[a-z]{2,4}$', stripslashes(trim($_POST['email'])))) { $e = ($_POST['email']); } else { $e = FALSE; echo '

Please enter a valid email address!

'; } if ($fn && $ln && $e) { // If everything's OK. // Make sure the email address is available. $query = "SELECT user_id FROM users WHERE email='$e'"; $result = mysql_query ($query) or trigger_error("Query: $query\n
MySQL Error: " . mysql_error()); if (mysql_num_rows($result) == 0) { // Available. // Create the activation code. //$a = md5(uniqid(rand(), true)); // Add the user. $query = "INSERT INTO users (email,first_name, last_name, registration_date) VALUES ('$e', '$fn', '$ln', NOW() )"; $result = mysql_query ($query) or trigger_error("Query: $query\n
MySQL Error: " . mysql_error()); if (mysql_affected_rows() == 1) { // If it ran OK. // Send the email. $body = "Thank you for registering for email updates from Venachar Lochside. \n\n"; //$body .= "http://www.venachar-lochside.co.uk/activate.html?x=" . mysql_insert_id() . "&y=$a"; mail($_POST['email'], 'Registration Confirmation', $body, 'From: admin@venachar-lochside.co.uk'); // Finish the page. echo '

Thank you for registering! A confirmation email has been sent to your address.

'; include ('./templates/venachar3/includes/footer.html'); // Include the HTML footer. exit(); } else { // If it did not run OK. echo '

You could not be registered due to a system error. We apologize for any inconvenience.

'; } } else { // The email address is not available. echo '

That email address has already been registered.

'; } } else { // If one of the data tests failed. echo '

Please try again.

'; } mysql_close(); // Close the database connection. } // End of the main Submit conditional. ?>

Join our mailing list?

Fishing Trossachs

If you have enjoyed your experience at Venachar Lochside, we would appreciate it if you would recommend us to your friends.

Just complete the form opposite and we will do the rest for you.