该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
register.php: 我感觉是不是insert这个地方出现问题,我试图填写不一样的密码但是他并没有提示错误而是跳转空白页
session_start();
$con = mysqli_connect('localhost','root','root','digital_wallet');
if(isset($_POST['r_btn'])){
session_start();
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string($_POST['password']);
$password2 = mysql_real_escape_string($_POST['password2']);
if($password == $password2){
//create user
$password = md5($password);//hash password before storing for security purposes
$sql = "INSERT INTO register(username, password,password2) VALUES('$username','$password','$password2')";
mysqli_query($con,$sql);
$_SESSION['message'] = "You are now logged in";
$_SESSION['username'] = $username;
header("location:wallet.php");
}else{
$_SESSION['message'] = "The two passwords do not match";
}
}
?>
Register