gpt4 book ai didi

php - 解析错误:语法错误,第48行/home/a4673434/public_html/index.php中的意外$ end

转载 作者:可可西里 更新时间:2023-11-01 07:56:29 25 4
gpt4 key购买 nike

<?php
$mysql_host = "*****.000webhost.com"; // Host masked
$mysql_database = "a4673434_main";
$mysql_user = "a4673434_main";
$mysql_password = "*****"; // password masked
$con = mysqli_connect($mysql_host,$mysql_user,$mysql_password,$mysql_database) or die("Error " . mysqli_error($link));
$email = $_POST["email"];
$confirmemail = $_POST["email2"];
$firstname = $_POST["firstname"];
$surname = $_POST["surname"];
$middlename = $_POST["middlename"];
$password = sha1($_POST["password"]);
$confirmpassword = sha1($_POST["password2"]);
$gender = $_POST["gender"];
$ip = $_SERVER["REMOTE_ADDR"];
$search_num = mysqli_query($con,"SELECT * FROM People WHERE email='$email'");
if(isset($email)) {
if($password!=$confirmpassword) {
echo "Your confirmation password doesn't match your main one!";
}
elseif($email!=$confirmemail) {
echo "Your confirmation email doesn't match your main one!";
}
elseif(mysqli_num_rows($search_num)!=0) {
echo "That email has been taken!";
}
else {
echo "Thanks for signing up!";
$sql = "INSERT INTO People (`firstname`,`lastname`, `email`, `gender`, `ip`, `lastip`, `password`, `middlename`) VALUES ('$firstname', '$surname', '$email', '$gender', '$ip', '$ip', '$password', '$middlename')";
}
?>
<form method="post" action="index.php">
First Name <input type="text" name="firstname" placeholder="First Name" required><br>
Middle Name <input type="text" name="middlename" placeholder="Middle Name" required><br>
Last Name <input type="text" name="surname" placeholder="Last Name" required><br>
Email <input type="email" name="email" placeholder="Email Address" required><br>
Confirm Email <input type="email" name="email2" placeholder="Confirmation Email Address" required><br>
Password <input type="password" name="password" placeholder="Password" required><br>
Confirm Password <input type="password" name="password2" placeholder="Confirmation Password" required><br>
Gender <select required name="gender">
<option selected value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select><br>
<input type="reset" value="Start Over">
<input type="submit" value="Register">
</form>

我该如何修正这个错误?我很烦。
分析错误:语法错误,意外的$end-in
/主页/a4673434/public_html/index.php,第48行
我没有在任何地方定义变量 $end。这个错误毫无意义。

最佳答案

您忘记关闭isset()的支撑
像这样加

    else {
echo "Thanks for signing up!";
$sql = "INSERT INTO People (`firstname`,`lastname`, `email`, `gender`, `ip`, `lastip`, `password`, `middlename`) VALUES ('$firstname', '$surname', '$email', '$gender', '$ip', '$ip', '$password', '$middlename')";
}
} // <-----------Add it here
?>

关于php - 解析错误:语法错误,第48行/home/a4673434/public_html/index.php中的意外$ end ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20021639/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com