|
楼主 |
发表于 2008-3-2 12:05:12
|
显示全部楼层
来自 中国–广东–佛山
回复: 简单PHP注册问题.
能教我怎么做吗?
[PHP]<?php
session_start();
$_POST["password"];
$_POST["password1"];
$_POST["password2"];
if (!session_is_registered("auth"))
{
header("location:index.htm");
}
else
include('conn.php');
$result=mysql_query("select * from admins where auth='$auth'");
$row = mysql_fetch_array($result);
if ($row["password"]<>$password)
{
echo "<script>alert('原密码错误返回!');history.back();</Script>";
}
else
if (($password1=='') or ($password2==''))
{
echo "<script>alert('新密码不能为空!');history.back();</Script>";
}
else
if ($password1<>$password2)
{
echo "<script>alert('新密码两次输入不一致!');history.back();</Script>";
}
else
{
mysql_query("update admins set password='$password1' where auth='$auth'");
echo "<script>alert('密码修改成功!在Cs控制台输入 setinfo uyang $password1');history.back();</Script>";
header("location:user.php");
}
?>[/PHP] |
|