I have tried with the following code:
if ($sp = fsockopen($host, $port)) {
fputs($sp,"POST /cgi-bin/sendsms HTTP/1.0\n"); fputs($sp,"Host: $host\n"); fputs($sp,"Content-type: application/x-www-form-urlencoded\n"); fputs($sp,"Content-length: ".strlen($postdata)."\n"); fputs($sp,"Connection: close\n\n"); fputs($sp,$postdata); fclose($sp);
}
and it didn't work.
The curious thing is if i put the URL of the sendsms script in the Mozilla browser or in the lynx program it works. What is
the diference between i passing the URL in a browser or inside a PHP code?
Simon Scott wrote:
why don't you use php's fopen function instead of lynx via a command shell?
----- Original Message ----- From: "Jo�o Reis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 20, 2004 3:37 PM
Subject: HTTP Post sample.
Hi Abdul,any virus detected has been removed using McAfee anti-virus software
I was reading the mailing list and found that you had a similar problem just like mine.
I'am integrating the sendsms cgi-bin in a PHP Code. I tried the curl libraries and executing with lynx from the command line and the answer is the same of yours (403 (Authorization failed from server)).
How did you solved the problem?
Thansk in advance
Jo�o Reis
This incoming email to UWE has been independently scanned for viruses and
-- \|/ "Do or do not. There is no try" - Yoda \|/ |==============================================| | 2000Comp - Consultoria e Inform�tica, Lda | | Tel: +351 22 941 99 32 | \|/ | Fax: +351 22 941 99 34 | \|/ O | www: http://www.2000comp.pt | O -|--| |--|- \| | Jo�o Reis | |/ / \ |==============================================| / \ ==========================================================
