我该如何解决这个错误?解析错误:语法错误,意外'; '在第23行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\ [英] How I can fix this error? Parse error: syntax error, unexpected '; ' in C:\xampp\htdocs\project\include\singup.inc.php on line 23
本文介绍了我该如何解决这个错误?解析错误:语法错误,意外'; '在第23行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<?php
if(isset($_POST['submit'])){
include_once 'dbh.inc.php';
$first = mysqli_real_escape_string($conn,$_POST['Fname']);
$email = mysqli_real_escape_string($conn,$_POST['email']);
$username = mysqli_real_escape_string($conn,$_POST['username']);
$pwd = mysqli_real_escape_string($conn,$_POST['password']);
$confirm = mysqli_real_escape_string($conn,$_POST['confirm']);
// error handlers
if ($pwd != $confirm) {
header("Location: ../singup.php?notsame=");
exit();
}
//check for empty fields
if(empty($first) || empty($email) || empty($username) || empty($pwd) || empty($confirm) ){
header("Location: ../singup.php?empty=");
exit();
}else{
// check if the input characters are valid
if(!preg_match("/^[a-zA-Z]*$/",$first){
header("Location: ../singup.php?invalid="); <<<<error is here
exit();
}else{
// check if emal is valid
if(filter_var(!$email, FILTER_VALIDATE_EMAIL)){
header("Location: ../singup.php?emailno=");
exit();
}else{
$sql = "SELECT * FROM users WHERE user_uid = '$username'";
$result = mysqli_query($conn,$sql);
$resultCheck = mysqli_num_rows($result);
if($resultCheck > 0){
header("Location: ../singup.php?usertaken=");
exit();
}else{
我尝试过:
i已在网上搜索解决方案,但没有工作
What I have tried:
i have searched the web for solutions but non worked
推荐答案
_POST ['submit'])){
include_once'dbh .inc.php';
_POST['submit'])){ include_once 'dbh.inc.php';
first = mysqli_real_escape_string(
first = mysqli_real_escape_string(
conn,
这篇关于我该如何解决这个错误?解析错误:语法错误,意外'; '在第23行的C:\ xampp \\\\\\\\\\\\\\\\\\\\\\\\\\的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文