提交后密码和确认密码不相等 [英] Password and confirmation passw not equal after submit

查看:170
本文介绍了提交后密码和确认密码不相等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

我正在写一个login.php脚本。

我使用md5将密码存储在mysql db中作为加密格式。

(这是在registration.php,它运作良好)。

注册新用户没有问题。


什么时候登录表单存在,密码和确认密码始终不匹配。它只显示密码不匹配,再次尝试。


任何人都可以帮助我..... ???错误工作的代码如下:


while($ info = mysql_fetch_array($ check))

{

$ _POST [''pass''] = stripslashes($ _ POST [''pass'']);

$ info [''password''] = stripslashes($ info [''password'' ]);

$ _POST [''pass''] = md5($ _ POST [''pass'']);

if($ _POST [''pass '']!= $ info [''密码''])

{

die(''密码错误,请再试一次。'');

}

else

{

$ _POST [''username''] = stripslashes($ _ POST [''username '']);

$小时=时间()+ 3600;

setcookie(ID_my_site,$ _POST [''username''],$ hour);

setcookie(Key_my_site,$ _POST [''pass''],$ hour);

header(" Location:members.php");

}

}


Plz ...很快告诉我正确的代码...

Hi friends,
I''m writing a login.php script.
I stored the password in mysql db as encrypted format using md5.
(It''s in registration.php and it works well).
There is a no problem in registering new users.

When the login form exists, the password and confirm password didn''t match always. It shows only "Password didn''t match, plz try again".

Can anyone help me.....??? The code which wrongly works is as follows:

while($info = mysql_fetch_array( $check ))
{
$_POST[''pass''] = stripslashes($_POST[''pass'']);
$info[''password''] = stripslashes($info[''password'']);
$_POST[''pass''] = md5($_POST[''pass'']);
if ($_POST[''pass''] != $info[''password''])
{
die(''Incorrect password, please try again.'');
}
else
{
$_POST[''username''] = stripslashes($_POST[''username'']);
$hour = time() + 3600;
setcookie(ID_my_site, $_POST[''username''], $hour);
setcookie(Key_my_site, $_POST[''pass''], $hour);
header("Location: members.php");
}
}

Plz... Tell me the correct code soon...

推荐答案

info = mysql_fetch_array(
info = mysql_fetch_array(


check))

{
check ))
{


_POST [''pass''] = stripslashes(
_POST[''pass''] = stripslashes(


这篇关于提交后密码和确认密码不相等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆