On 10/2/09 10:06 AM, "MEM" <tal...@gmail.com> wrote:
> I'm now understanding that even if the form is submitted to self, we can
> still use a redirect to a "success_message_page.php". However, we must do
> this redirect, AFTER the form has submitted to himself. It's the only thing
> that we have to pay attention here, correct?
> Since we are not dealing with a confirmation page, or a multi-step form, the
> hidden field isn't necessary.
> It's this correct assumptions?
the server script that runs in response to an http request for uri X can
determine if "conditions of success" are met only after the server receives
the request for X. so, if i understand your question, yes.
i think your terminology is confusing you, e.g.: "AFTER the form has
submitted to himself". a form doesn't submit to itself. a form and a script
that processes it are SEPARATE THINGS.
it's better to think in terms of a user agent and a server communicating
with http requests and responses. the UA sends http requests for uris X, Y,
Z, etc. (with or without accompanying form data). the forms are part of html
pages the server sends to the UA in http responses. a user drives the UA.
PHP scripts are involved in the server's generation of responses. (a diagram
now to your queston:
if a UA has an html page that it got in a response for uri X; and if the
page has a form; and if the form has no action attribute (or action=X); and
if the user submits the form; then the UA will send the server an http
request for X.
next the server receives the request for X and the server runs a certain
script, the php script you are coding.
now i'm assuming these are your requirements: if that script determines
failure, the user says at X and is asked to resubmit the form. if the script
determines success, the user will wind up at a new uri: Y. further, you want
to send the user over to Y by sending her UA an http response with
in these terms, the answer to your question should be pretty clear. your
script has to receive and process requests for X before it can decide if
it's going to respond to the UA with a Location=Y redirection or an html
page with a form and an error message.
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php