is_valid) { // $error_recaptcha = "The reCAPTCHA wasn't entered correctly."; // } // else{ $host = "localhost"; $user = "bedbreak_admin"; $password = "3SMQfQah"; $connection = mysql_connect($host,$user,$password) or die ("Couldn't connect to server"); $database = "bedbreak_availability"; $db = mysql_select_db($database) or die ("Couldn't connect to database"); $query = "SELECT * FROM a1_member WHERE email='$email'"; $result = mysql_query($query) or die ("Couldn't execute query."); if (mysql_num_rows ($result) >= 1){ $row = mysql_fetch_array($result, MYSQL_ASSOC); $establishment = $row['establishment']; $firstname = $row['firstname']; $lastname = $row['lastname']; $username = $row['username']; //** Create temp passcode ********************************************************************// $tempPass = rand(10000, 1000000000); $salt = substr ($tempPass, 0, 2); $tempPass = crypt($tempPass, $salt); $tempPass = ereg_replace("[^A-Za-z0-9]", "", $tempPass ); $tempPass = substr($tempPass, 1, 20); // echo "tempPass".$tempPass; $tempExpire = mktime() + 86400; $tempExpire = date('Y-m-d H:i:s', $tempExpire); // echo $tempExpire; $query = "UPDATE a1_member SET tempPass = '$tempPass', tempExpire = '$tempExpire' WHERE email = '$email'"; $result = mysql_query($query); //** Get email text **************************************************************************// $query = "SELECT * FROM a2_email WHERE email_id = 'forgot_pass_BBA'"; $result = mysql_query($query); $row = mysql_fetch_array($result, MYSQL_ASSOC); $subject = $row['subject']; $msg_text = $row['msg_text']; $msg_html = $row['msg_html']; $Bcc1 = $row['Bcc1']; $Bcc2 = $row['Bcc2']; //** send email **************************************************************************// $msg_text = str_replace("[tempPass]", $tempPass, $msg_text); $msg_text = str_replace("[establishment]", $establishment, $msg_text); $msg_text = str_replace("[firstname]", $firstname, $msg_text); $msg_text = str_replace("[lastname]", $lastname, $msg_text); $msg_text = str_replace("[email]", $email, $msg_text); $msg_text = str_replace("[username]", $username, $msg_text); $msg_html = str_replace("[tempPass]", $tempPass, $msg_html); $msg_html = str_replace("[establishment]", $establishment, $msg_html); $msg_html = str_replace("[firstname]", $firstname, $msg_html); $msg_html = str_replace("[lastname]", $lastname, $msg_html); $msg_html = str_replace("[email]", $email, $msg_html); $msg_html = str_replace("[username]", $username, $msg_html); $boundary = uniqid('np'); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"" . $boundary . "\"\r\n"; $headers .= "From: Bed Breakfast Availability " . "\r\n"; if ($Bcc1 != NULL){ $headers .= "Bcc: <$Bcc1>" . "\r\n"; } if ($Bcc2 != NULL){ $headers .= "Bcc: <$Bcc2>" . "\r\n"; } mail($email, $subject, "\r\n\r\n--" . $boundary . "\r\n" . "Content-Type: text/plain; charset=\"utf-8\"\r\n\r\n" . $msg_text . "\r\n\r\n--" . $boundary . "\r\n" . "Content-Type: text/html; charset=\"utf-8\"\r\n\r\n" . "\n\n" . "\n\n" . $msg_html . "" . "\r\n\r\n--" . $boundary . "--", $headers); $passSent = 1; } else{ $error_email = "Email is not in the database - please try again.
Can't remember your email? Call 01628 481711"; } // } } ?> Bed and breakfast availability - recover password
Bed & Breakfast Availability
20 $town bed and breakfasts"; // echo "

15 $town hotels

"; // echo "

5 $town guest houses

"; // echo "

3 $town self-catering accommodation

"; ?>

Bed and breakfast availability
b&b, guesthouse and hotel accommodation

Advertise your accommodation

Please check your mail box in 5 mins and follow the link contained in the email.

"; echo "

If you can't find the email - please check your spam folder and mark the email as \"Not spam\".

"; } else{ echo '

Lost Your Password?

Once you have submitted the form, you will receive an email containing a link that you must click for further instruction.
If you can\'t find the email - please check your spam folder and mark the email as "Not spam".

Password recovery


'; if (isset($error_email)) { echo ""; } // echo ' // // // '; // // if (isset($error_recaptcha)) { // echo " // // // "; // } echo '
Your email:
".$error_email."
// // //
// ".$error_recaptcha." //
'; } ?>