我有一個登記表http://mutualpay.byethost7.com/wp/register.php?i=1 ..我的表單動作是signup.php ..我創建的文件,但它似乎並沒有工作,當我點擊註冊按鈕它加載到http://mutualpay.byethost7.com/wp/signup.php?i=2,它喜歡它的文件使用在線文件管理器上傳文件到您的網站
這是我signup.php代碼中沒有執行代碼
<?php session_start(); include 'dpconfig.php';
$first = $_POST['firsts'];
$last = $_POST['last'];
$uid = $_POST['uid'];
$pwd = $_POST['pwd'];
if (empty($firsts)){
header("Location: register.php?error=empty");
exit();
}
if (empty($last)){
header("Location: register.php?error=empty");
exit();
}
if (empty($uid)){
header("Location: register.php?error=empty");
exit();
}
if (empty($pwd)){
header("Location: register.php?error=empty");
exit();
}
else {
$sql = "INSERT INTO user (firsts, last, uid, pwd)
VALUES ('$firsts', '$last', '$uid', '$pwd')";
$result = $conn->query($sql);
header("Location: index.php")
}
它像不執行這個代碼,COS點擊註冊按鈕後,它帶來了一個空白頁面,我不知道可能是什麼原因,任何幫助表示讚賞。謝謝
PHP中的空白頁通常是錯誤的標誌。檢查PHP日誌。您還可以啓用錯誤報告以在頁面上顯示錯誤。還要注意,你的代碼對於SQL注入來說是全開放的,所以你可以試着去執行任何事情。 – David