Forgotten Password Script

 
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials
View previous topic :: View next topic  

Is this usefull?
Yes
0%
 0%  [ 0 ]
No
100%
 100%  [ 4 ]
Total Votes : 4

Author Message
demonhunter
-


Joined: 14 Jun 2003
Posts: 79

PostPosted: Fri Dec 19, 2003 9:50 am    Post subject: Forgotten Password Script Reply with quote

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 View user's profile Send private message AIM Address
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Fri Dec 19, 2003 10:06 am    Post subject: Reply with quote

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 View user's profile Send private message
demonhunter
-


Joined: 14 Jun 2003
Posts: 79

PostPosted: Tue Dec 23, 2003 5:20 am    Post subject: Reply with quote

Most id in html if you can see
Back to top View user's profile Send private message AIM Address
00squeaky
-


Joined: 11 May 2004
Posts: 60

PostPosted: Sun Jul 04, 2004 10:20 pm    Post subject: Reply with quote

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 View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Tutorials All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group