Hi everybody,
I am looking for a simple "Forgot password" script for my website.
By the way you are more than welcome to check out my site that I built with BlueVoda.
http://www.iqtest4fun.com
Thank you.
Hi everybody,
I am looking for a simple "Forgot password" script for my website.
By the way you are more than welcome to check out my site that I built with BlueVoda.
http://www.iqtest4fun.com
Thank you.
A forgot password script needs to
1. Have a user input (usually the username, or user email address)
2. Verify that this username or email address is registered in the databse
3. Email, to the registered email address, the login details.
So the actual coding of this script depends on the structure of your databse table.
As you understand, there is no way that there can be a script that will suit all cases. It has to be made case by case.
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
I found a script but it isn't working.
Could you please take a look at it and tell me why it keeps giving me
"no such login in the system. please try again."
even when I use a loginid that is in my database.
<?php
@mysql_pconnect("localhost", "", "") or die("Cannot connect to DB!");
@mysql_select_db("") or die("Cannot select DB!");
$sql="SELECT password,email FROM forms WHERE loginid='$loginid'";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
if(mysql_affected_rows()==0){
print "no such login in the system. please try again.";
exit();
}
else {
$row=mysql_fetch_array($r);
$password=$row["password"];
$email=$row["email"];
$subject="your password";
$header="from:ydmmtbz@iqtest4fun.com";
$content="your password is .$password.";
mail($email, $subject, $row, $header);
print "An email containing the password has been sent to you";
}
?>
That specific script checks for a column called "loginid" from the table "forms" for a value. The script does not collect any data to be checked against the database. (Usually posted data from a form).
The script has 2 check
The first checks if the query is successful
The second checks if a row in the table was found
If it passes both then it will display the information from the row in the table.
Yours is failing in the second check
You need to post the data to the script for it to check the database with
Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
Thanks.So how would you modify that particular script?
It would depend on the form that the user enters their login id in to have their information emailed.
Basically, assuming that the "name" attribute of the text field they enter their login id is "loginid", then just add:
$loginid = $_POST['loginid'];
Andwhere before this line:
$sql="SELECT password,email FROM forms WHERE loginid='$loginid'";
Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
1. Create a login form. There the user should type his "loginid" in a fie ld named "loginid". (though usually this is more known as "username rather than "loginid"). Set the form action to be this very script.
Then, add the lines in red in your script:
<?php
$loginid = trim($_POST['loginid']);
@mysql_pconnect("localhost", "user", "password") or die("Cannot connect to DB!");
@mysql_select_db("dbname") or die("Cannot select DB!");
$sql="SELECT password,email FROM forms WHERE loginid='$loginid'";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
if(mysql_affected_rows()==0){
print "no such login in the system. please try again.";
exit();
}
else {
$row=mysql_fetch_array($r);
$password=$row["password"];
$email=$row["email"];
$subject="your password";
$header="from:ydmmtbz@iqtest4fun.com";
$content="Your password is $password.";
mail($email, $subject, $content, $header);
print "An email containing the password has been sent to you";
}
?>
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
Ooops! Sorry Watdaflip. Just had the browser open and didn't see that you had already posted.
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
Hi guys,
I can't figure out why I keep getting the following error:
Parse error: syntax error, unexpected '=' in /home/.../public_html/forgot.php on line 28
Any ideas?
what is line 28 of your script?
Register/Login Script
Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script
This is the entire script:
<?php
loginid = trim($_POST['loginid']);
@mysql_pconnect("localhost", "", "") or die("Cannot connect to DB!");
@mysql_select_db("") or die("Cannot select DB!");
$sql="SELECT password,email FROM forms WHERE loginid='$loginid'";
$r = mysql_query($sql);
if(!$r) {
$err=mysql_error();
print $err;
exit();
}
if(mysql_affected_rows()==0){
print "no such login in the system. please try again.";
exit();
}
else {
$row =mysql_fetch_array($r);
$password=$row["password"];
$email=$row["email"];
$subject="your password";
$header="from:ydmmtbz@iqtest4fun.com";
$content="your password is .$password.";
mail($email, $subject, $content, $header);
print "An email containing the password has been sent to you";
}
?>
Funny thing is there isn't a line 28 ?!
Did you by any chance paste the the script in a html page ?
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
No,it is php I just double-checked again.
It makes no sence. I suggest that you connect with FTP, double click on the "forgot.php" file. Notepad should open with the file content in it. Copy and post here the actual code if it is different from the one you posted.
Or, if you wish, send me your login details, and i will have an inside look.
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
Hi,
as i thought, you have pasted the script in an empty BV page, which has added some lines of code, that's why the script was givin error in line 28. In fact, there was a $ missing:
$loginid = trim($_POST['loginid']);
Fixed and uploaded on the server.
I also sent you an email but got a message about your mailbox being full.
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
Thank you for fixing that.
Now the problem is that I keep getting "no such login in the system. please try again.".I use a loginid that is in my database and still get that.Can you go back inside and see why?
Also you mentioned my mailbox being full.When I go to webmail in my control panel it says it is empty!?What is going on?I might be missing important mail from my members and I don't even know it!
What's the link to the form that sends to the forgot.php ?
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
login.php
Change the Enctype of your login.php form in "multipart / form data", save and republish
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
GREAT.It is working now.
By the way what do you say about my mailbox being full when it is in fact empty?
I think I got it.
The neomail trash folder filled up my quota.I didn't bother to check the trash folder only the new mail that's why I missed it the first time.
For everybody out there if this ever happens to you then just raise the quota and your mailbox will never get full even if you forget to check it for a while.
Navaldesign,thanks for all your help .
Glad you sorted it. By the way, i did raise your webmail quota to 100 MB
Navaldesign
Logger Lite: Low Cost, Customizable, multifeatured Login script
Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!
There are currently 1 users browsing this thread. (0 members and 1 guests)