时间:2021-07-01 10:21:17 帮助过:60人阅读
Welcome back
Log in: |
Please enter your user name!
'; } if(empty($_POST['password'])) { $problem = true; print 'Please enter a password
'; } if(!$problem) { $user = trim(stripslashes($_POST['user_name'])); $pwd = trim(stripslashes($_POST['password'])); $user = mysql_real_escape_string($user); $pwd = mysql_real_escape_string($pwd); $q = "SELECT * FROM USER WHERE USER_NAME = '$user' and PASSWORD = '$pwd'"; echo $q; $result = mysql_query($q); if(!$result || mysql_num_rows($result) == 0) { print 'Wrong Username or Password.
'; } else { $row = mysql_fetch_array($result); $id = $row['USER_ID']; $name = $row['USER_NAME']; echo "User ID is ".$id; session_start(); $_SESSION['$id'] = $id; //clear the POST array $_POST = array(); //网上找来的办法, 但貌似不管用 } } else { print 'Please try again!
'; } }?>
改为
即可
PHP code?12345678 input type=text 是单行文本编辑器
如果你给他的是多行的文本,那么只有第一行可以被编辑。这就是你遇到的问题的原因
怎么会有这种事???
=================================================
我是来学习的
可能是 你post 赋值时有问题,post 的值只会覆盖上一个,怎么会附加呢..