我一直试图让注册会员ip插入数据库,我目前的代码如下:
$ip = $_SERVER['REMOTE_ADDR'];
if(mysqli_query($con, "INSERT INTO users(name,email,password,ip) VALUES('" . $name . "', '" . $email . "', '" . md5($password) . "', '$ip')")) {
$successmsg = "Successfully Registered! <a href='login.php'>Click here to Login</a>";
} else {
$errormsg = "Error in registering...Please try again later!";
}
当它插入数据库时,它输入一个完全不同的字符串。
Database fields