inthisx_00
New member
I have two php files. one is register.php and the other is index.php.
When a user clicks a link and is brought to register.php, $_SERVER['HTTP_REFERER'] will record
index.php,and assign "index.php" to $_SESSION['get'];
So now I am sure that $_SESSION['get'] has "index.php".
But when the use submits the form, $_SESSION['get'] is considered "null" and generates a new value "index.php" from $_SERVER['HTTP_REFERER'];.
How to resolve this problem?
I want $_SESSION['get'] to be "index.php" so that header function will guide the user to index.php.
<?
if ($_SESSION['get']==null)$_SESSION['get']=$_SERVER['HTTP_REFERER'];
if ($_POST['id']) header("location: ".$_SESSION['get']);
?>
<form name="login" method="post">
<input type="text" name="id">
<input type="submit" name="send" value="login">
</form>
mistake modification.
But when the use submits the form, $_SESSION['get'] is considered "null" and generates a new value "register.php" from $_SERVER['HTTP_REFERER'];.
mistake modification.
When a user clicks a link at index.php and is brought to register.php,
any help would be greatly appreciated.
When a user clicks a link and is brought to register.php, $_SERVER['HTTP_REFERER'] will record
index.php,and assign "index.php" to $_SESSION['get'];
So now I am sure that $_SESSION['get'] has "index.php".
But when the use submits the form, $_SESSION['get'] is considered "null" and generates a new value "index.php" from $_SERVER['HTTP_REFERER'];.
How to resolve this problem?
I want $_SESSION['get'] to be "index.php" so that header function will guide the user to index.php.
<?
if ($_SESSION['get']==null)$_SESSION['get']=$_SERVER['HTTP_REFERER'];
if ($_POST['id']) header("location: ".$_SESSION['get']);
?>
<form name="login" method="post">
<input type="text" name="id">
<input type="submit" name="send" value="login">
</form>
mistake modification.
But when the use submits the form, $_SESSION['get'] is considered "null" and generates a new value "register.php" from $_SERVER['HTTP_REFERER'];.
mistake modification.
When a user clicks a link at index.php and is brought to register.php,
any help would be greatly appreciated.