Password reset not working

I got a ptc script from my friend and i have installed on a free hosting.
problem is password reset not working. it’s show that password reset email send.
but i don’t get any email. what can i do please help me. my website: www.viewbangla.in
help me please. i need help so much.

reset.php code:

<!doctype html public “-//W3C//DTD HTML 4.01 Transitional//EN”>

Viewbangla register - Part Time Online Job & Earn Money From Home <?php if(!defined('GEN2_PROCESS')) { exit(); } $ref_title = "Reset Your Password";

$tok_id = sha1(md5(session_id()));
if($loggedin)
{
$error = “You are already logged in.”;
$show_login=0;
} elseif($_GET[‘k’] and $_GET and $_SESSION[‘rp_key’] and $_GET[‘k’] == $_SESSION[‘rp_key’])
{
$gen_pw = microtime().md5(time());
$new_password = sha1($gen_pw);
mysql_query(“UPDATE users SET password=’$new_password’ WHERE username=’{$_SESSION[‘rp_user’]}’ LIMIT 1;”);
$epconts .= "Hello User,

We’ve successfully changed your password for {$set[‘site_name’]}.
You’re new password for {$set[‘site_name’]} is “$gen_pw” (without the quotes).

Thanks,
{$set[‘site_name’]}";
mail($_SESSION[‘rp_email’], “New Password - “.$set[‘site_name’], $epconts, “From: admin@”.$_SERVER[‘HTTP_HOST’].”/nX-Mailer: GeN2”);
$_SESSION[‘rp_key’] = false;
$_SESSION[‘rp_user’] = false;
$_SESSION[‘rp_email’] = false;
$contents .= “

Check Your Inbox… Again.


We’ve now sent your new password to your inbox so you can immediately log-in.
”;
} elseif($_POST)
{
$username = $do->filter($_POST[‘login_username’]);
$email = $do->filter($_POST[‘login_email’]);

if(!$username)
{
$error=(!$error) ? “You forgot to fill in the username field.” : $error;
$show_login=1;
}
if(!$email)
{
$error=(!$error) ? “You forgot to fill in the e-mail field.” : $error;
$show_login=1;
}

$u_ex = mysql_query(“SELECT COUNT(*) AS cnt FROM users WHERE username=’{$username}’ AND email=’{$email}’ LIMIT 1;”);
$u_ex = mysql_fetch_array($u_ex);
$u_ex = $u_ex[‘cnt’];

if(!$u_ex)
{
$error=(!$error) ? “We couldn’t find an account with those details.” : $error;
$show_login=1;
}

if(!$error)
{
$my_rp_key = md5(time());
$_SESSION[‘rp_key’] = $my_rp_key;
$_SESSION[‘rp_email’] = $email;
$_SESSION[‘rp_user’] = $username;

$emconts = "Hello User,

You recently requested for your password to be changed on {$set[‘site_name’]}. If you authorised this request, please click below and we will re-send your new generated password so you can login into your account.

Copy and paste the link below to have your password sent to you.
“.($do->get_loc()).”/reset.php?k={$my_rp_key}

After you have visited the link below we’ll send your new password to you’re inbox and then you should be able to log in.

Thanks,
{$set[‘site_name’]}";

mail($email,“Password Reset - “.$set[‘site_name’], $emconts, “From: admin@”.$_SERVER[‘HTTP_HOST’].”/nX-Mailer: GeN2”);

$contents = "

Check Your Inbox

Please check you're inbox for a e-mail containing a URL. Please visit that URL which will then send your new generated password to your inbox because you have authorised the request. You will not be authorised to enter any information during the process.

 

We sent the e-mail to $email. Thanks!

";

$show_login=0;

}

} else {
$show_login=1;
}
if($error)
{
$contents .= “

$error
”;
}
if($show_login)
{
$contents .= <<<EOF

Reset Your Password

Username

E-Mail Address


Back to Login
EOF; } ?>

Well, if your friend made it, i’d have him come over and troubleshoot it.

change
mail($email,“Password Reset - “.$set[‘site_name’], $emconts, “From: admin@”.$_SERVER[‘HTTP_HOST’].”/nX-Mailer: GeN2”);

$contents = "

Check Your Inbox

Please check you're inbox for a e-mail containing a URL. Please visit that URL which will then send your new generated password to your inbox because you have authorised the request. You will not be authorised to enter any information during the process.

 

We sent the e-mail to $email. Thanks!

";

$show_login=0;

to
[php]$sent = mail($email,“Password Reset - “.$set[‘site_name’], $emconts, “From: admin@”.$_SERVER[‘HTTP_HOST’].”/nX-Mailer: GeN2”);
if($sent) {
$contents = "

Check Your Inbox

Please check you're inbox for a e-mail containing a URL. Please visit that URL which will then send your new generated password to your inbox because you have authorised the request. You will not be authorised to enter any information during the process.

 

We sent the e-mail to $email. Thanks!

";
   $show_login=0;
} else {
   $contents = "<p>Email not sent, please check back later</p>";
}

[/php]
That’ll add the proper confirmation. as you have it, you’ll get it even if it didn’t get sent out, which does’t help any if you’re trying to troubleshoot it.

And is this a windows or a linux host? it does make a difference because there’s a bug with the mail() function that hasn’t been resolved.

i have install this script on linux hosting.

Should i add anywhere in script my email id so that email can send from my email id?

$sent = mail($email,“Password Reset - “.$set[‘site_name’], $emconts, “From: admin@”.$_SERVER[‘HTTP_HOST’].”/nX-Mailer: GeN2”);

is this code is adress of mail sending server.
If yes, can i change it?
if no, how script send email? is there are need any email server name?
please anyone answer it.
sorry for bad english…

Alot of free web-hosts also don’t allow mail() to be used. That could easily be your problem.

Sponsor our Newsletter | Privacy Policy | Terms of Service