0

我有request.php一个表格,它也处理到同一页面。如果用户未登录/未注册,则已处理的request.php.

请求.php

   if(isset($_POST['submit'])) {
    //post variables
    //sign up form if not signed in
    } 

    //form

注册表单在 上处理register.php。所以request.php->request.php(process)->register.php。如果用户注册不成功register.php并按下后退按钮,我会得到document expired. 我该如何解决这个问题?它应该只显示带有表单的页面。

4

1 回答 1

0

只需输入一个header('location:request.php');如果用户注册失败request.php

而且,PHP 本身会做带你回来的工作。

也许是这样的..

if(isset($_POST['submit'])){

  if(isset($_POST['username']) && !empty($_POST['username'])) {

   // authentication code goes here
   } // if username is empty, then.. `header('location:request.php')` // this means go back.


} else { echo " enter user id, to log in";}
于 2012-12-11T20:14:58.923 回答