我有 3 个文件……signup.js
$("#signup-form").submit(function(e){
e.preventDefault();
var theForm = new FormData(this);
$.ajax({
url: "php-includes/signup-parser.php",
method: "POST",
data: theForm,
contentType: false,
processData: false,
success:function(data){
// Redirecting
location.href = "account.php";
}
}
})
注册解析器.php
# Cookie creator
setcookie('id',1,60);
# Manually set it,if not set
if (!isset($_COOKIE['id']))
$_COOKIE['id'] = 1;
最后是主页 account.php
# is_a_cookie_set is function that checks if a cookie is set.
if (!is_a_cookie_set()){
die("<h1>No cookie set</h1>");
}
我的目的是在注册解析器上设置一个 cookie,然后重定向到帐户页面,这需要设置一个 cookie。问题是无法在注册解析器中设置 cookie……我一直没有设置 cookie……有什么想法是错误的吗?
白板的微信
缥缈止盈