一个php登入界面我刚学,都搞了两天了,还不行,高手教教我吧

来源:百度知道 编辑:UC知道 时间:2024/06/19 14:34:41
我的想法是;我在mysql中做了一个数据库名叫drjm,里面有一张user的数据表,里面的内容又userid,user(用户名),password(密码)
我一共写了两段代码
<div class="ceng1" align="center">
<form method="post" name="dr" action="drht.php">
<div class="ceng2"><img src="../image/1140388084f399f9be3e1e7f.jpg" width="1200" height="100"/></div>
<div class="ceng3">请输入帐号:<input type="text" name="uesr" size="30" /></div>
<div class="cneg4">请输入密码:<input type="password" name="password" size="32" /></div>

<div class="ceng6"><input type="submit" value="提交" name="tj" /><input type="reset" value="重填" name="tj2" /><

$mima=$row['password'];

$row = mysql_fetch_assoc(mysql_query(" SELECT user,password FROM user where name = '$user' and password = '$password'"));

$mima=$row[password];------>$mima=$row['password'];

建议 你先用 print_r($_POST) 函数检查下 传递的数值,并且用die()终止程序

然后 在适当位置 print_r($row) 检查下并且用die()终止程序

这是你贴出来的php页面里检查的

在student.php
1.看有否使用 session_start()
2.用print_r($_SESSION) 检查下session 的值 并且用die()终止程序

-------------------------

至于上面两位说的 $row['password'] 这里 加不加无影响......

你可以用这个测试下~

<?php
$row['passwd'] = "我是密码";
die( $row[passwd] );
?>