我有一个登记表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