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.
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!
?>
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 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 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.
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.
<?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'>";
}
?>
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