Re: [PHP] php forcing a post??

2007-02-20 Thread Richard Lynch
On Tue, February 20, 2007 1:45 pm, blackwater dev wrote:
> I currently have an html page that posts to a cgi function.  I need to
> interject some php in the middle.  So, the form will post to itself,
> the php
> page will catch the post, check on thing and then pass along to the
> cgi page
> but the cgi page only handles posts.  How can I still php in the
> middle and
> still have it 'post' to the cgi page?

Google for "Rasmus Lerdorf" "function PostToHost"

It's a lot simpler than you'd think, actually.

You just fsockopen to port 80, compose a valid POST HTTP request and
write it out.

If you have file uploads in the original form, life gets slightly more
complex, as you have to compose a more complicated POST, I guess, but
it should still be a lot easier than you may be thinking.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php forcing a post??

2007-02-20 Thread Stut

Peter Lauri wrote:
Or cURL: http://php.net/curl 


Seems like a lot of work to me, not to mention added complexity. I 
highly doubt there's anything you can do in PHP that you can't do in the 
CGI script.


If you really must do this, the easiest way would be to have the CGI 
call out to a PHP script, rather than trying to intercept the request 
itself.


Alternatively, do an AJAX request in the onsubmit for the form that does 
the PHP bit, and if the response is good, then post the form.


-Stut


-Original Message-
From: blackwater dev [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 20, 2007 9:45 PM

To: php-general@lists.php.net
Subject: [PHP] php forcing a post??

I currently have an html page that posts to a cgi function.  I need to
interject some php in the middle.  So, the form will post to itself, the php
page will catch the post, check on thing and then pass along to the cgi page
but the cgi page only handles posts.  How can I still php in the middle and
still have it 'post' to the cgi page?

Thanks!



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php forcing a post??

2007-02-20 Thread Peter Lauri
Or cURL: http://php.net/curl 

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free


-Original Message-
From: blackwater dev [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 20, 2007 9:45 PM
To: php-general@lists.php.net
Subject: [PHP] php forcing a post??

I currently have an html page that posts to a cgi function.  I need to
interject some php in the middle.  So, the form will post to itself, the php
page will catch the post, check on thing and then pass along to the cgi page
but the cgi page only handles posts.  How can I still php in the middle and
still have it 'post' to the cgi page?

Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] php forcing a post??

2007-02-20 Thread Peter Lauri
fsockopen can probably help you with that http://www.php.net/fsockopen 

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free


-Original Message-
From: blackwater dev [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 20, 2007 9:45 PM
To: php-general@lists.php.net
Subject: [PHP] php forcing a post??

I currently have an html page that posts to a cgi function.  I need to
interject some php in the middle.  So, the form will post to itself, the php
page will catch the post, check on thing and then pass along to the cgi page
but the cgi page only handles posts.  How can I still php in the middle and
still have it 'post' to the cgi page?

Thanks!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php