domain.com =关于在去测试 LAUNCH.domain.com =醒目网页和文本字段有人可以输入邀请码到
auth_check.php网站 - 这launch.domain。 COM的帖子就提交
如果匹配的初始页面上在输入的数据auth_checkphp则该用户被重定向到domain.com的
如果用户从未到过的domain.com他们会发送到launch.domain.com
这个问题。
当我在launch.domain.com中输入代码时,它会将我发送到domain.com,因此它工作正常。
但是cookie没有被存储。在我关闭浏览器并重新打开它回到domain.com我发送到launch.domain.com
这里是我的代码。
auth_check.php
<?php
$invite_code = "getaccess"; ----that is the code that must be entered in to form
$site_url = "http://www.domain.com"; --- main domain....
$thank_you_url = "http://www.domain.com/register.php"; ---- page they get sent to after entering the correct code
if(isset($_POST['invite_code']) && $_POST['invite_code'] == $invite_code) {
setcookie("can_see","true"); ----- invite code is the name of the text field
header("Location: ".$thank_you_url);
exit;
}
header("Location: ".$site_url);
exit;
?>
的index.php
<?php
$register_url = "http://www.launch.domain.com";
if(!$_COOKIE['can_see']) {
header("Location: ".$register_url);
exit;
}
?>
形式是工作的罚款。所以我会离开了这一点
我只是测试这一个最后的时间,它在Internet Explorer工作正常 - 设置cookie在Chrome和IE,但它并不存储
任何投入将是巨大的!
感谢很多
这是一个额外的代码行添加到index.php或这是否替换第4-6行?另外,就饼干的好处而言呢?我只是将0改为正确的东西?这个数字是几小时,几天,还有别的? – Eric 2011-04-10 05:19:41
我补充说,以auth检查,但同样的事情,我发现0结束了不同的颜色,所以我把报价周围,但仍然没有好处。 – Eric 2011-04-10 05:31:50
您可以将它保留为0,它只是告诉cookie在浏览器会话结束时过期,或者您可以设置日期和时间以使其在将来的特定时间到期。根据您的编辑器,0可能是不同的颜色,因为它是一个数字。 – 2011-04-10 06:04:01