0
此登錄過程在我的本地主機上正常工作,但是當我將其上載到主機上並嘗試在實時服務器上測試時,它失敗! 我上傳了我的數據庫到服務器,並試圖用註冊用戶登錄,但是當我提交表單時什麼都沒有發生! 我使用ajax並提醒從服務器返回的數據,它只是提醒一個空白的消息,沒有錯誤,沒有警告,沒有數據迴應!登錄表單在本地主機上正常工作,但不在主機上
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$id;
$status = 1;
require_once("../scripts/config.php");
$stmt = $con->stmt_init();
if ($stmt = $con->prepare("SELECT COUNT(email) AS counte FROM users WHERE email=?"))
{
$stmt->bind_param("s", $username);
$stmt->execute();
$obj = $stmt->get_result()->fetch_object();
$counte = $obj->counte;
$stmt->close();
}
if($counte == 1) // email mojud ast
{
if ($stmt = $con->prepare("SELECT COUNT(*) AS countr, id, fname, lname, img FROM users LEFT JOIN userd ON users.id = userd.userid WHERE email=? AND password=?"))
{
$stmt->bind_param("ss", $username, $password);
$stmt->execute();
$obj = $stmt->get_result()->fetch_object();
$countr = $obj->countr;
$id = $obj->id;
$fname = $obj->fname;
$lname = $obj->lname;
$img = $obj->img;
$stmt->close();
if($countr == 0)
{
echo "incorrect";
}
else if($countr == 1)
{
session_start();
$_SESSION['userid'] = $id;
echo $img."*".$fname." ".$lname."*".$id."*";
}
}
}
else if($counte == 0)
{
echo "notexist";
}
mysqli_close($con);
?>
as i sa ID它在我的本地主機上正常工作!我認爲問題是與準備好的聲明,因爲我查了其他查詢,我發現他們都沒有工作! – behruz
你檢查了你的php.ini嗎? – KimDev
我不知道如何從c面板訪問它! – behruz