Passing HTTP POST information to another script - How?

This is a discussion on Passing HTTP POST information to another script - How? within the PHP Language forums, part of the PHP Programming Forums category; Dave Smithz wrote: > Hi there, > > I have a situation where I want to have multiple submit buttons ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-20-2005
R. Rajesh Jeba Anbiah
 
Posts: n/a
Default Re: Passing HTTP POST information to another script - How?

Dave Smithz wrote:
> Hi there,
>
> I have a situation where I want to have multiple submit buttons on

the same
> form and therefore want to use a redirection php script that checks

the
> value associated with the submit form variable to calculate which

submit was
> pressed and then redirects the user to another php page accordingly.
>
> I used:
> headers ("location:myphpscript.php")
>
> to do this.
>
> However automatically this does not pass on the information sent in

the form
> POST. I did start looking into reencoding the $_REQUEST into a GET

string to
> append to the URL, but this is a bit crude because the original form

submit
> uses a post and had a lot of information (some of which is also held

in
> $_FILES).
>
> So is there a better way to go about this? How can I simulate a POST?


I don't know, why you have to redirect to another page. If you have
some good Form handler mechanism, you can do like this (in the same
page--even witout losing the clarity/readability/etc):

if ( $foo->isFormSubmitted($_POST, 'deposit') )
{
$foo->isValidDepositFields() and
$foo->addToDepositTable();
}
else if ( $foo->isFormSubmitted($_POST, 'withdraw') )
{
...
}

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:35 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0