You are here: Re: how to get values of a redirected a POST request ? « PHP Programming Language « IT news, forums, messages
Re: how to get values of a redirected a POST request ?

Posted by Carl on 12/18/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация