| Author |
How can I do this in PHP
|
|
|
| Good Day,
I have a CGI script that I want to convert to PHP (it has to post variables
in the "http headers" to another server that runs a cgi script.
The cgi script that does the posting (which I want to convert to php) is as
follows:
require LWP;
$addy = "http://10.10.10.10/xys/xyzname/register.cgi";
$ua = new LWP::UserAgent;
my $header = HTTP::Headers->new('IDNUM'=>'1234567890123','ACCNUM'=>'123');
my $request = HTTP::Request->new('POST',"$addy",$header);
$request->content("$xml");
$response = $ua->request($request);
$reply_msg = $response->content;
print "||$addy||\n";
print "||$reply_msg||\n";
Hope somebody can help out ;-)
| |
| Dennis de Wit 2006-07-27, 7:56 am |
| tony wrote:
> Good Day,
>
> I have a CGI script that I want to convert to PHP (it has to post variables
> in the "http headers" to another server that runs a cgi script.
>
> The cgi script that does the posting (which I want to convert to php) is as
> follows:
> require LWP;
>
> $addy = "http://10.10.10.10/xys/xyzname/register.cgi";
>
> $ua = new LWP::UserAgent;
>
> my $header = HTTP::Headers->new('IDNUM'=>'1234567890123','ACCNUM'=>'123');
>
> my $request = HTTP::Request->new('POST',"$addy",$header);
>
> $request->content("$xml");
>
> $response = $ua->request($request);
>
> $reply_msg = $response->content;
>
> print "||$addy||\n";
>
> print "||$reply_msg||\n";
>
>
>
> Hope somebody can help out ;-)
Mhhh... I have tried this before. I didn't find a good sollution to
this, other than writing a socket application that opens a connection to
that other site.
You can try these functions: http://nl2.php.net/manual/en/ref.http.php
good luck.
Dennis
| |
|
| Dennis de Wit napisał(a):
> Mhhh... I have tried this before. I didn't find a good sollution to
> this, other than writing a socket application that opens a connection to
> that other site.
Mhhh... Don't You think that cURL isn't enough ? :)
http://pl2.php.net/manual/pl/ref.curl.php
--
Pozdrawiam,
Sawi
www.fruitysite.net
| |
| Dennis de Wit 2006-07-27, 6:56 pm |
| Sawi wrote:
> Dennis de Wit napisał(a):
>
> Mhhh... Don't You think that cURL isn't enough ? :)
> http://pl2.php.net/manual/pl/ref.curl.php
>
Sorry... i was on a windows server :-O You're right... curl should do
the trick. I never thought of that
Dennis
| |
|
| Dennis de Wit napisał(a):
> Sorry... i was on a windows server :-O You're right... curl should do
> the trick. I never thought of that
cURL is also available on a windows server. It's very useful tool :)
--
Pozdrawiam,
Sawi
www.fruitysite.net
| |
| Dennis de Wit 2006-07-28, 3:57 am |
| Sawi wrote:
> Dennis de Wit napisał(a):
>
>
> cURL is also available on a windows server. It's very useful tool :)
>
Wokey... I'll look into that. I didn't know that. But still; my web
hosting provider must have it installed to enable me to use it.
Anyway... Does Tony have a sollution to his problem yet?
Dennis
| |
|
| Dennis de Wit napisał(a):
> Wokey... I'll look into that. I didn't know that. But still; my web
> hosting provider must have it installed to enable me to use it.
This extension is very rarely disabled :)
> Anyway... Does Tony have a sollution to his problem yet?
Should have - we gave him two ways of it.
--
Pozdrawiam,
Sawi
www.fruitysite.net
| |
| Dennis de Wit 2006-07-28, 3:57 am |
| Sawi wrote:
> Dennis de Wit napisał(a):
>
>
> This extension is very rarely disabled :)
>
>
> Should have - we gave him two ways of it.
>
Pffff... I just dont want to use it ok? :-P I'll keep looking for
reasons not to use it :)
I'm going back to work :)
Dennis
| |
|
| Hello.
I will give curl a shot and see how it goes!
"Sawi" <sawi4@lpteno.atzc.op> wrote in message
news:eacgrr$djo$1@news.onet.pl...
> Dennis de Wit napisal(a):
>
>
> This extension is very rarely disabled :)
>
>
> Should have - we gave him two ways of it.
>
> --
> Pozdrawiam,
> Sawi
> www.fruitysite.net
|
|
|
|