Re: Transfering post data to a series of pages.
| From: | dpgirago at mdanderson dot org | Date: | Wed, 04 May 2005 16:25:47 +0000 |
| Subject: | Re: Transfering post data to a series of pages. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-39361@lists.php.net to get a copy of this message | ||
Perry, Matthew (Fire Marshal's Office) wrote:
> Is there a way to transfer post data to a series of PHP pages?
>
> For example, lets say I have the following 4 pages:
> Page1.php - this page has my original post form
> Page2.php - this page does one thing with the post data
> Page3.php - this page does another thing with the post data
> Page4.php - this page shows the results of everything I have done
>
> Right now I am using the header: <?header("Location: page3.php");?>
>
> The problem is, the following works:
> Page1.php - this page has my original post form
> Page2.php - this page does one thing with the post data
> Page3.php - this page shows the results of everything I have done
>
> But when I try to add the second transfer the data is lost:
> Page1.php - this page has my original post form
> Page2.php - this page does one thing with the post data
> Page3.php - this page does another thing with the post data
> Page4.php - Only the results from Page2.php are shown!!!!
>
> ASP does this with <%Server.Transfer ("transferpage1.asp")%>
> Is there a counterpart with PHP?
>
> - Matthew
Martin Norland wrote:
>> include() :P
>> seriously though, Page1.php and Page4.php are the only two pages that
>> should exist, if any. Page2 and Page3 should pretty much guaranteed be
>> turned into function calls or classes and called from Page4.php. You
>> don't need to separate logic and display in separate scripts that you
>> push everything at, just separate your logic out into function calls.
What Martin suggests makes a lot of sense. Can you say something about why
you have the site design the way that you do?
David