<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login</title>
<style>
label{
width:100px;
float:left;
}
</style>
</head>
<body>
<div class="login_form">
<form action="login.php" method="post" >
<p>
<label for="email">E-mail:</label>
<input name="email" type="text" id="email" size="30"/>
</p>
<p>
<label for="password">Password:</label>
<input name="pass" type="password" id="pass" size="30"/>
</p>
<p>
<input name="submit" type="submit" value="Submit"/>
</p>
</form>
</div>
<?php
echo $count;
session_start();
include('configdb.php');
mysql_select_db("upload_site2", $con);
// username and password sent from form
$email=$_POST['email'];
$pass=$_POST['pass'];
// To protect MySQL injection (more detail about MySQL injection)
$email = stripslashes($email);
$pass = stripslashes($pass);
$email = mysql_real_escape_string($email);
$pass = mysql_real_escape_string($pass);
$sql2=mysql_query("SELECT * FROM registration WHERE email='$email' and password='$pass'");
$result=mysql_query($sql2);
echo $email;
// Mysql_num_row is counting table row
$count=mysql_num_rows($result);
// If result matched $myusername and $mypassword, table row must be 1 row
if($count==1){
// Register $myusername, $mypassword and redirect to file "login_success.php"
session_register("email");
session_register("password");
header("location:member.php");
}
else{echo'wrong';}
?>
</body>
</html>
当我打开此代码的页面时,它直接显示屏幕上的回显(错误),然后我甚至写电子邮件,并通过.also当我输入电子邮件,并通过它不重定向到“member.php”,但它保持在同一页... thnx的帮助登录和注册表格
我试过所有这些但仍然相同problemm ..它不给我任何错误 – Paso 2012-03-22 08:17:21
添加后检查并删除回显后显示新代码。 – MrCode 2012-03-22 08:30:43
ive推他的代码,但在差异任务plz看到它overthere..and非常感谢你 – Paso 2012-03-22 08:43:13