|
Posted by Richard Levasseur on 12/18/95 11:50
Carl wrote:
> these are three files below :
> submit.html
> <html>
> <head>
> </head>
> <body>
> <form action="redirect.php" method="POST" >
> <input type="text" name="value" value="test" >
> <input type="submit" >
> </form>
> </body>
> </html>
>
> redirect.php
> <?php
> header("HTTP/1.1 303 See Other");
> header("Location: post.php");
> ?>
>
> post.php
> <html>
> <head>
> </head>
> <body>
> <?php
> if(isset($_REQUEST['value'])) {
> echo "the value is : <font color=RED >{$_REQUEST['value']}</font>";
> }
> ?>
> </body>
> </html>
> 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? I use "apache http server
> 2.0.58" with "php 5" , "ms IE 6.0" and "firefox 1.5.0".
You lose posted data when you redirect. You would need to re-post the
data along with sending the redirect, which i'm not sure is possible,
never tried it myself.
Why can you simply include the file?
Since you're using apache, you could use mod_rewrite to transparently
rewrite the request, not sure if that would accomplish what you want to
do.
Navigation:
[Reply to this message]
|