Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Redirect a form back to the calling script
January 17, 2007, 2:35 am
rate this thread
So here is the situation I'm in. My PHP script does something like
1. Update a DB (only once)
2. Send some post data to another PHP script (only once)
3. Output some stuff related to 1 and 2.
I've done #2 by using input type="hidden" on a form, like so:
print "<form action='../dir/register.php' method='post'
print "<input type='hidden' name='username' value='$sname' >";
print "<input type='hidden' name='email' value='$email' >";
print "<input type='hidden' name='password' value='$pwd' >";
print "<input type='hidden' name='password2' value='$pwd' >";
This works awesomely, but the problem is that control flows to the
script that performs the action on the form. I kinda want to send this
stuff to the PHP script, and then continue processing the rest of PHP
script #1. In the UNIX world I would put the form job in the
background. Is there a way of doing that here?
Re: Redirect a form back to the calling script
Yes, you can do the post without any clientcontact by using a package name
With CURL you can also catch the output of the called script (#2), maybe to
check for errors or something like that.
Also, stop using:
and switch to:
Erwin Moller wrote:
My FF2 run with both
Didn't try with my other browsers
That advice makes sense if you look at the HTML 4.01 or XHTML 1.0
specification where the type attribute on the script element is
mandatory while the language attribute is deprecated. So to have valid
HTML 4.01 or XHTML 1.0 markup you script elements need to have a type
On the other hand that type attribute was introduced to allow
several places in the HTML 4.01 specification but was not a registered
MIME type when the HTML 4.01 specification was published and that status
remained that way for several years.
<http://www.rfc-editor.org/rfc/rfc4329.txt changed that, so
uses) are now officially registered MIME types but they have at the same