Re: HTTP post without using form fields
| From: | Richard Lynch | Date: | Wed, 13 Dec 2000 21:59:24 +0000 |
| Subject: | Re: HTTP post without using form fields | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30193@lists.php.net to get a copy of this message | ||
> Can somebody help me sending received $HTTP_POST_VARS to another page
> without using hidden form fields?
>
> I have an user input form for a database, then I want to validate input
data
> trough an invisible php page (using window.location to change the page
after
You could more easily use header("Location: whatever.php?x=3&y=4..."); but
that would be GET, not POST.
There is a PostToHost function Rasmus wrote long ago, as well as Manuel
Lemos' class that would allow you to POST the data directly from PHP --
still not using window.location.
If you *really* want to use JavaScript, I guess you could build a FORM with
all INPUT TYPE=HIDDEN elements, and then add some JavaScript at the bottom
to submit it. Look around the net for some "onClick" JavaScript that does
the submit right away, and then put that into a <SCRIPT LANGUAGE=JavaScript>
tag at the very bottom of your HTML, maybe after the </BODY> even... This
is a pretty lame way to do it, but you could.
Finally: You may want to reconsider your design. It will be far easier to
maintain if you put it all in one "page". There is sample code in the
various code archives http://php.net/links.php
You can still provide modularity to keep yourself sane with include files,
but keeping the top-level logic in a single PHP page will probably make your
life easier...
> validation process). If the validation is ok I'll open another page, if
not
> I'll return to the input form adding a comment (error description) and
> keeping user's input.
>
> regards,
> Adi Ionescu <adi@perfect4.net>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>