|
Posted by Carl on 12/12/56 11:50
NC wrote:
> Carl wrote:
> >
> > these are three files below :
>
> [Snippets deleted]
>
> > When I submit, it does redirect to 'post.php', but it doesn't show
> > "test". If I change the submit.html to use the "GET" method ,and append
> > "?value={$_GET['value']}" to the url int the redirect.php, it works
> > well. Why the "POST" method doesn't work?
>
> Because redirection uses the GET method.
>
> You should consider either including post.php into redirect.php or
> saving the POSTed values into session variables:
>
> redirect.php
> <?php
> session_start();
> $_SESSION = $_POST;
> header("HTTP/1.1 303 See Other");
> header("Location: post.php");
> ?>
>
> post.php
> <?php
> session_start();
> if(isset($_SESSION['value'])) {
> echo "the value is : <font color=RED >{$_SESSION['value']}</font>";
> }
> ?>
>
> Cheers,
> NC
In fact ,the destination that I want to redirect to is not developed by
me , and they won't change their code for me. They use "POST" to get
values ,I have to redirect the POST request.
Navigation:
[Reply to this message]
|