Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/292.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 意外的文件结束协助_Php - Fatal编程技术网

Php 意外的文件结束协助

Php 意外的文件结束协助,php,Php,因此,我创建了我的第一个网站,在提交注册表格中的数据时,我在文档的第43行出现了一个错误,指出“文件意外结束”。我一直在寻找错误,据我所知,我没有发现任何错误。我查看了这个站点上的其他线程,并检查了作为解决方案提供给其他人的问题。没有什么。有人能帮忙吗?这是我的密码 <?php session_start(); include '../dbh.php'; $first = $_POST['first']; $last = $_POST['last']; $email = $_POST['

因此,我创建了我的第一个网站,在提交注册表格中的数据时,我在文档的第43行出现了一个错误,指出“文件意外结束”。我一直在寻找错误,据我所知,我没有发现任何错误。我查看了这个站点上的其他线程,并检查了作为解决方案提供给其他人的问题。没有什么。有人能帮忙吗?这是我的密码

<?php
session_start();
include '../dbh.php';

$first = $_POST['first'];
$last = $_POST['last'];
$email = $_POST['email'];
$uid = $_POST['uid'];
$pwd = $_POST['pwd'];

if (empty($first)){
    header("Location:../signin.php?error=empty");
    exit();
}
if (empty($last)){
header("Location:../signin.php?error=empty");
exit();
}
if (empty($email)){
    header("Location:../signin.php?error=empty");
    exit();
}
if (empty($uid)){
    header("Location:../signin.php?error=empty");
    exit();
}
if (empty($pwd)){
    header("Location:../signin.php?error=empty");
    exit();
    } else{
        $sql ="SELECT uid FROM user WHERE uid='$uid'";
        $result = $conn->query($sql);
        $uidcheck = mysqli_num_rows($result);
        if ($uidcheck > 0){
        header("Location:../signin.php?error=username");
        exit();
}   else {
    $sql = "INSERT INTO user (first, last, email, uid, pwd) 
    VALUES ('$first', '$last', '$email', '$uid', '$pwd')";
    $result = $conn->query($sql);

    header("Location:../index.php");
添加这两行:

}
?>

在脚本末尾。

您缺少结尾}?>结尾处。。