Dave Smithz wrote:
[color=blue]
> 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.[/color]
Why can't you just combine your PHP scripts (either in a single file or with
"require" statements)?
[color=blue]
> I used:
> headers ("location:myphpscript.php")
>
> to do this.[/color]
By redirecting POST requests you are asking for trouble. For example, take a
look at <http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html>. A
simple header statement just won't work properly, even if you get the syntax
right and use an absolute URI like you're supposed to.
[color=blue]
> 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).[/color]
By redirecting a POST request you're asking the client's browser to re-issue
the request to a different URL. That would mean sending the file twice. I
don't think that's a good idea. :-/
[color=blue]
> So is there a better way to go about this? How can I simulate a POST?[/color]
Do all your server-side processing at the URL specified by the form's action
attribute. That's the way things are supposed to work. Or use different
forms linked to different server-side scripts.
Could you perhaps explain a bit more about what you're trying to do with
this form?
[color=blue]
> My second related question on this subject (I was going to post this
> separately but it's probably better here) is whether there is a limit to the
> amount of information that can be passed via an HTTP GET.
> I once remember reading there is a 255 character limit to a URL address and
> if this also includes the variable information after the ? this is quite
> restrictive.[/color]
I think it' more like 4096 characters, but don't take my word for it. It's
definitely a lot more than 255.
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/