Lavalair forgot password

Started on the old forum in May 2009 · view the original in the archive · old links redirect here

#chat #htportal #hypetype #lavalair #password

20 replies · 2,297 views · started 17 years ago · 1 min read

TL;DR · summary of 20 replies
  • - The fix for the password mismatch issue was to ensure the hashed passwords in the database matched with the ones sent via email.
  • - The code approach involved adding a function or check within the forgot password script to verify if the entered password matches the stored hash, returning an error message otherwise.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

8 participants
hypetype Developer · 128 posts #1

i coded the forgot password script and want to share it. and it works perfectly for me.

make a file called forgot.php and put the coding below inside it

<?php
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
echo("<?xml version=\"1.0\"?>");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<?php
include("config.php");
include("core.php");

$bcon = connectdb();

include("forgot2.php");
$a = $_GET["a"];
$em = $_POST["em"];
$username = $_POST["username"];

 if($a=="s"){
 echo "<card id=\"log\" title=\"Forgot Password\">\n";
echo "<p align=\"center\">";
 if($em==""){
 echo "$error1<br/>";
 echo "<a href=\"invite.php?sid=$sid\">$errorlnk</a><br/>";
 }//else if($nick==""){
 
 //echo "$error2<br/>";
 //echo "<a href=\"invite.php?sid=$sid\">$errorlnk</a><br/>";
 //}
 else{

$pwd = mysql_fetch_array(mysql_query("SELECT pwd FROM ibwf_users WHERE name='".$username."'"));

$message = "This email is a password reminder.
Your username is: $username
Your password is: $pwd[0]

Login at: http://forum.htportal.net/login.php?loguid=$username&logpwd=$pwd[0]

";
 
 $to = "$em";

$subject = "HTPortal.net Password";

$txt = "$message";

$headers = "From: no-reply@htportal.net";

mail($to,$subject,$txt,$headers);
echo "Password Sent!<br/>Username: $username<br/> Sent To: $em<br/>";
echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
 
 
 }
 echo "</p>";
echo "</card>";
     }else{
	 echo "<card id=\"log\" title=\"HT Portal Password Sender\">\n";
echo "<p align=\"center\">";
echo "<img src=\"$image\" alt=\"*\"/><br/>";

echo "$admin<br/><br/>";

echo "Your Username:<br/>";

echo "<input type=\"username\" name=\"username\" value=\"\" maxlength=\"20\"/><br/>";

echo "Your Email:<br/>";
echo "<input type=\"em\" name=\"em\" maxlength=\"50\"/><br/>";

echo "<anchor>Send password<go href=\"forgot.php?a=s\" method=\"post\">";
echo "<postfield name=\"username\" value=\"$(username)\"/>";
echo "<postfield name=\"em\" value=\"$(em)\"/></go></anchor><br/>";	 
echo "<a href=\"index.php\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
	 echo "</p>";
echo "</card>";
	 }

?>

</wml>
hypetype Developer · 128 posts #2

next make a file called forgot2.php and put the code below in it

<?php
$sid = $_GET["sid"];
$nick = getnick_sid($sid);
/*
Coded by hypetype(SHANE)
Site: http://htportal.net
Contact: hypetype@gmail.com
Note: This script is a free script.. edit, modify, update but dont own it lol
======Proud To Be a Jamaican!=========
/*

/*
this deals with the errors the page is suppose to give off!
*/
$error1 = "Please go back and write your email!";
$error2 = "Please go back and write your name!";
$errorlnk = "Resend Invitation!";
////End of Errors!/////////////////////////////////////

/*
this deals with the page appearance :P
*/

$invmsg = "You are invited to join http://htportal.net chat by your friend, $nick.
This chat site has great chat friends online.
Click on this link http://htportal.net to meet alot of people world wide and also in your country.";

$admin = "Forgot Your Password?<br/>Fill in the fields below to have your password sent to your email!<br/>
<b>NOTE: <u>THE PASSWORD WILL BE SENT TO THE EMAIL ADDRESS THAT IS REGISTERED TO THE USERNAME!!!</u></b>
";
$image = "images/logo.gif";
$homet = "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>Home</a>";
$title = "HT Portal forgot password";

/////The End!

?>
hypetype Developer · 128 posts #3

put this coding on the login.php page

             mysql_query("UPDATE ibwf_users SET lastvst='".$lact[0]."', pwd='".$pwd."', browserm='".$ubr."' WHERE id='".$idn."'");

and in the database add a table in ibwf_users called pwd Type = varchar(30) Collation = latin1_swedish_ci Default leave it blank

riderz Lead · 975 posts #5

tanx for sharing will have a look


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

subzero Super moderator Fellow · 3,954 posts #6

Hey shane nice to see your sharing 🙂

Keep the good work up bro 🙂 😎

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

poormaster23 Junior · 10 posts #8

this code is not safe.is easy to hack ur nick.. even is not my email automatic send your password..

hypetype Developer · 128 posts #9

poormaster23 wrote: this code is not safe.is easy to hack ur nick.. even is not my email automatic send your password..

is did u find an error? cause i use it on my site and everythin is workin pretty well? as i said if u find an error let me know so i can have a further look into it and try fix it for youB)

alesh Lead · 604 posts #10

i dont like 2 think tht some1 can reset my password...

and its easy... if u know my email u can daily reset my pass grrrrrr

even if u disable email in user profil its kind of tricky...

and its anoying lol

i think would be better 2 add simple additional security question during registration etc

or even better "password reset and sent to ur email, u have 20 min to login otherwise it will be reset to old one"

😛

oh btw u may think about adding this function 2 ur script cuz its really bad without it

    function safemail ($header) {
         $header = str_replace ("\n", "\0", $header);
         $header = str_replace ("\r", "\0", $header);
         return $header;
    }

and

$headers = "From: ". safemail ("no-reply@htportal.net");

and

$em = htmlspecialchars($_POST["em"]);

etc...

at least 4 start lol

eeeeerrr....

alesh Lead · 604 posts #12

hypetype wrote: this is not gonna reset ur password. its gonna send the password to ur email if u forget it?

oh i wasnt bodered 2 look out the code lol

i assume...

anyway its not bulet proof lol its very unsafe

eeeeerrr....

modfiles Developer · 200 posts #13

alesh wrote: oh i wasnt bodered 2 look out the code lol

i assume...

anyway its not bulet proof lol its very unsafe

how did you know its unsafe if you say that you didnt bothered to look out the code? 😕

i think there should be a function somethin like security question? so that if someone might know your email add, they cant just resend it anytime they want.

alesh Lead · 604 posts #14

modfiles wrote: how did you know its unsafe if you say that you didnt bothered to look out the code? 😕

i think there should be a function somethin like security question? so that if someone might know your email add, they cant just resend it anytime they want.

lol u can c tht from the plain LMAO

eeeeerrr....

Anshul Senior · 296 posts #15

try something like this 🙂

   <?php
include 'config.php';
include 'core.php';

if(isset($_POST['submit']))
{    
  $email=$_POST['email'];
  $getinfo="SELECT login from users where email='$email'";
  $getinfo2=mysql_query($getinfo) or die("Could not get info");
  $getinfo3=mysql_fetch_assoc($getinfo2);
  if($getinfo3)
  {
     $pass = substr(preg_replace('/\W/', '', md5(rand())), 0, 8);
     $changepass= mysql_query("update `users` SET `pass`='".md5($pass)."' WHERE `email`='".$email."'");
     mail("$email","From Chat-Zone.mobI","Your login details login $getinfo3[login] &Password $pass");   
     print "Instruction for changing your password have been mailed to you.";
  }
  else
  {

    print "Retrieve Password";
    print "There is not a user with that e-mail address";
  }
  
}
else
{

  print "<form method='POST' action='getpassword.php'>";
  print "Your e-mail:</td><td><input type='text' name='email' length='45'>";
  print "<input type='submit' name='submit' value='submit'>";
}
?> 
djlee Developer · 224 posts #18

if your going to store plain text passwords atleast encrypt them with either aes or your own bi-directional algorithm. What you do is completely unsafe for your users (yes some users do use sensitive passwords on general chat sites believe it or not) and its quite disrespective of the users right to have sufficient security emplacements.

when inserting/updating use AES_ENCRYPT() and when you wanna send them their passes use AES_DECRYPT. Its not fool proof (no bi-directional hashing algorithm is) but its better than plain text if you dont wanna create your own algorithms

poormaster23 Junior · 10 posts #19

password not match?.. u share code is not complet..im looking that code i cant find u share it.can u pls post the complet script:(

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close