View previous topic :: View next topic |
Is this usefull? |
Yes |
|
0% |
[ 0 ] |
No |
|
100% |
[ 4 ] |
|
Total Votes : 4 |
|
Author |
Message |
demonhunter -
Joined: 14 Jun 2003 Posts: 79
|
Posted: Fri Dec 19, 2003 9:50 am Post subject: Forgotten Password Script |
|
|
Some of you may want a forgotten password script to go with your login scripts and that this may help you this script was fully made by my brother here it is
<?php
function showheader ($title) {
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<TITLE> <?php echo $title ?> </TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<?php
}
function showfooter () {
?>
</CENTER>
</BODY>
</HTML>
<?php
}
mysql_connect("localhost", "!dbusers", "!dbpass");
mysql_select_db("users!");
$table = 'users!';
if ($Name == $Name) {
$user = mysql_query("SELECT * FROM $table WHERE (Name='$Name')");
if (mysql_num_rows(w) > 0) {
showheader("Yes!");
?>
<?php
$result = mysql_query("SELECT * FROM $table WHERE (Name='$Name')");
$i = 0;
$email = mysql_result($result,$i,"Email");
$passwd = mysql_result($result,$i,"Password");
mail("$email", "Site Information", "Hello $Name,\n
Your password was requested from $REMOTE_ADDR.\n
Your Password: $passwd.", "From: Webmaster <Enter your Email address here>");
echo ("Your password has been sent to your email inbox for security reasons :-)");
?>
<?php
showfooter();
}
else {
showheader("Unknown User");
?>
Unknown User
<?php
showfooter();
}
}
else {
showheader("Error!");
?>
Error!
<?php
showfooter();
echo("
<TABLE>
<TR>
<TD><FONT FACE="ARIAL" SIZE="-1">User Name</FONT></TD>
<TD><INPUT TYPE="text" NAME="Name"></TD>
</TR>
<TR>
<TD COLSPAN=2><CENTER><INPUT TYPE="submit"
VALUE="Submit"></CENTER></TD>
</TR>
");
}
?> |
|
Back to top |
|
|
Anonymoose -
Joined: 09 Sep 2003 Posts: 2192
|
Posted: Fri Dec 19, 2003 10:06 am Post subject: |
|
|
I might be missing something but with a Submit shouldn't there be some <FORM> tags somewhere ? Feel free to laugh if I'm wrong, I suck at PHP :D |
|
Back to top |
|
|
demonhunter -
Joined: 14 Jun 2003 Posts: 79
|
Posted: Tue Dec 23, 2003 5:20 am Post subject: |
|
|
Most id in html if you can see |
|
Back to top |
|
|
00squeaky -
Joined: 11 May 2004 Posts: 60
|
Posted: Sun Jul 04, 2004 10:20 pm Post subject: |
|
|
hmm.
very intrigueing.
but you would need this:
Code: |
<form action="precover.php">
enter your username and birthdate
<input name=uname value="username">
<input name=bdate value="Birthday">
<input type=submit value="recover">
</form>
|
and in the processor
Code: |
//too lazy to write connections... mysql_connect(...);
function randword(){
$i = rand();
$j = rand();
$npass= $i + $j;
}
$roo = randword();
$uname = $_COOKIE['username']
mysql_query("UPDATE users SET password='".$roo."' WHERE uname='".$uname."'");
?> | [/code] _________________ Languages mastered:
HTML,GML,C,PHP,MYSQL (not really a language, but wtf) |
|
Back to top |
|
|
|