[FX.php List] [OFF] Submitting a POST automatically
Bob Patin
bob at patin.com
Wed Jul 8 15:50:43 MDT 2009
Andrew,
Thanks for the response; once I thought more about it, I realized the
solution: I just put this in the BODY tag:
onload="javascript:form2.submit();"
and it submits the form after the PHP processes, which is exactly what
I was needing to do.
Best,
Bob Patin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new_logo_idea3_120w.jpg
Type: image/jpeg
Size: 15728 bytes
Desc: not available
Url : http://mail.iviking.org/pipermail/fx.php_list/attachments/20090708/a82a30c5/new_logo_idea3_120w-0001.jpg
-------------- next part --------------
Longterm Solutions
bob at longtermsolutions.com
615-333-6858
http://www.longtermsolutions.com
iChat: bobpatin
FileMaker 10 Certified Developer
Member of FileMaker Business Alliance and FileMaker TechNet
--------------------------
FileMaker hosting and consulting for all versions of FileMaker
PHP ? Full email services ? Free DNS hosting ? Colocation ? Consulting
On Jul 8, 2009, at 4:22 PM, Andrew Denman wrote:
> Bob,
>
> I can't tell if this code does what you want it to do, but I ran
> across it the other day when searching for header() help. It's
> posted on the php.net header() manual comments: http://us2.php.net/manual/en/function.header.php#89447
>
> <?php
> $host = "www.example.com";
> $path = "/path/to/script.php";
> $data = "data1=value1&data2=value2";
> $data = urlencode($data);
>
> header("POST $path HTTP/1.1\r\n" );
> header("Host: $host\r\n" );
> header("Content-type: application/x-www-form-urlencoded\r\n" );
> header("Content-length: " . strlen($data) . "\r\n" );
> header("Connection: close\r\n\r\n" );
> header($data);
> ?>
>
> Andrew Denman
>
>
> -----Original Message-----
> From: fx.php_list-bounces at mail.iviking.org [mailto:fx.php_list-bounces at mail.iviking.org
> ] On Behalf Of Bob Patin
> Sent: Wednesday, July 08, 2009 3:37 PM
> To: FX.php Discussion List
> Subject: [FX.php List] [OFF] Submitting a POST automatically
>
> I've got a rather odd need on a site:
>
> In this site, members login to the site, and are verified in the
> database. So far so good.
>
> As members, they can also go to another site; to get to it, I have
> to use a POST to send specific variables to the 2nd site, but I only
> want logged-in members to be able to do so.
>
> If they're NOT logged-in already, I'd like to have the login process
> page validate them, then automatically submit a FORM that I've put
> on the same page.
>
> I tried using
>
> header("location: javascript:form2.submit();");
>
> at the end of my PHP, but it wouldn't process. So here's my question:
> is there a way for me to do this:
>
> 1. query the db, validate the user (already done this) 2. submit a
> form that uses a POST (can't be a GET) without user interaction
>
> There's probably a simple way, but I haven't found it yet; thanks,
>
> Bob Patin
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
More information about the FX.php_List
mailing list