无法与mysqli连接

时间:2017-09-02 10:33:22

标签: php mysql mysqli

我创建了一个简单的登录系统,用户必须输入他的凭据才能注册,但即使我输入我的凭据来注册字段总是被认为是空的,我认为问题出在mysqli中,即使我有mysqli DLL和扩展名据说在php.ini中启用,有人可以建议吗? 这就是我的联系方式

<?php

$dbServername = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbName = "loginsystem";

$conn = mysqli_connect($dbServername,$dbUsername,$dbPassword,$dbName);

这是凭据验证的一部分:

<?php

if(isset($_POST['submit']))
{
    include_once 'dbh.inc.php';

    $first = mysqli_real_escape_string($conn, $_POST['first']);
    $last = mysqli_real_escape_string($conn, $_POST['last']);
    $email = mysqli_real_escape_string($conn, $_POST['email']);
    $uid = mysqli_real_escape_string($conn, $_POST['uid']);
    $pwd = mysqli_real_escape_string($conn, $_POST['pwd']);

    //Error handlers
    //check for empty fields

    if(empty($first) || empty($last) || empty($email) || empty($uid) || empty($pwd)){
    header("Location: ../signup.php?signup=empty");
    exit();
    }

0 个答案:

没有答案