阅读背景:

注册php会在尝试注册时继续出现连接重置错误

来源:互联网 
<?php
session_start();
include 'dbConnection.php';
?>
<!DOCTYPE HTML>
<html>
<head>
    <title>Online Book Club</title>

</head>

<body>
    <form method ="post" action ="register.php">

           <?php
        //get the values from the form, using the POST method.
        $first_name = $_POST['first_name'];
        $last_name = $_POST['last_name'];
        $profession = $_POST['profession'];
        $gender = $_POST['gender'];
        $date_of_birth = $_POST['date_of_birth'];
        $country_of_residence = $_POST['country_of_residence'];
        $email = $_POST['first_name'];
        $username = $_POST['username'];
        $password = $_POST['password'];


   $query = "SELECT username FROM user WHERE username ='$username'";
       $result = mysqli_query($link, $query) ;

        if (mysqli_num_rows($result) >= 1) {
           echo $message ="WARNING: Name already exist <br/>";
           echo $message = "<a href='/go.html?url=register.php'>Return</a>";

        }
        else  {
        $queryInsert = "INSERT INTO user   (  first_name,last_name,profession,gender,date_of_birth,country_of_residence,em    ail,username,password)" .
                    "VALUES ('$first_name', '$last_name', '$profession', '$gender', '$date_of_birth', '$country_of_residence', '$email', '$username', '$password')";
        //echo $queryInsert;
        //echo $queryInsert;
        $resultInsert = mysqli_query($link,$queryInsert); 
        header('Location: login.php');
            echo "<h3>The following user has been successfully added:    </h3>";

    }


    ?>

    Click <a href="/go.html?url=admin.php"> here </a> to go back to the home page.
</body>
<?php
session_start();
include 'dbConnection.ph



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: