gsb wrote:
HOW TO: Submit a form to PHP with no return?
I need to submit a form for file upload to a PHP script but do not want
anything returned.
That is the TARGET for the form should be like a null device.
I am using a JavaScript function to submit the form.
Is there a way to do this?
gsb
gsb, when someone uses a form such as for the purposes of obloading,
that form sends a request to the web server containing the uploaded data.
Because HTTP is a request/response protocol, your browser will "allways"
wait for and act on a response that the server will inevitably
provide (if nothing breaks).
Hence, you always have to put whatever you want to come next in a page
pointed to by the form action attribute.
If you don't want the screen to change, then point the action attribute
to the same file containing the form we are talking about.
A nice trick would be to use the onSubmit javascript event attribute in
the form element to pop up a new window which is also then specified in
the target element of the form attribute. The action attribute in the
form element can then point to a handling script which doesn't output
anything other than
<html><head/><body onload="documen t.close();" /></html>