Try some debugging
PHP Code:
<?php
ini_set("display_error", 1);
error_reporting(E_ALL);
// MySQL Information.
$db_host = "localhost"; // Host, 99% of the time this is localhost.
$db_username = "notexper_two"; // Username here
$db_password = "three"; // Password here
$linkID = mysql_connect("$db_host", "$db_username", "$db_password") or die(mysql_error());
// query commands
mysql_select_db("notexper_one", $linkID) or die(mysql_error()); // Database here
$resultID = mysql_query("SELECT user_email FROM jobseekers WHERE user_email = '$user_email'", $linkID) or die(mysql_error());
// End of query commands
// Check if Email is in database
$num_rows = mysql_num_rows($resultID);
$row = mysql_fetch_row($resultID);
$user_id = $row[0];
if ($user_id == ""){
print "We're sorry, your Email does not appear to be in our database.";
}else{
// Create a new, random password.
$password = substr (MD5(uniqid(rand(), 1)), 3, 10);
// Make the query.
$query = "UPDATE jobseekers SET password=password('$password') WHERE user_id = '" . $_SESSION['seeker'] . "'";
$result = mysql_query ($query); // Run the query.
if (mysql_affected_rows()){ // If it ran OK
// Send Password to email
// send email
$to = "$user_email";
$subject = 'Your job has been added';
$message = 'Password: $password';
$headers = 'From: christhedonkey2007@yahoo.co.uk';
if(mail($to, $subject, $message, $headers)){
echo "Your Password has been sent to $user_email ";
}
}
}
// End of Send Password to email
mysql_close($linkID);
?>
</body>
</html>
<?php include ("footer.php") ?>
Bookmarks