0

同じページに処理するrequest.phpフォームがあります。ユーザーがサインイン/サインアップしていない場合、サインアップ フォームが処理済みの に含まれますrequest.php

request.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 に答える