Posting parameter using socket | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through September 15, 2003 ⬆ |
◄ ► |
Author | Message | |||
Anonymous |
Hi, We are trying to post parameters to nowsms server by opening a socket from php.Here is the code in php which we are using ////////////////////////////////////////// $url = "PhoneNumber=+919821895185&Text=Hello cyril"; $datei = fsockopen("217.40.66.161", 80, &$errno, &$errstr); if( !$datei ) { echo "Connection Error !"; exit(); } else { fputs($datei,"POST /217.40.66.161:8800/Send Text Message.htm HTTP/1.1\r\nHost: 217.40.66.161\r\nContent-Length:". strlen($url)."\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: Close\r\n\r\n$url"); } fclose($datei); ////////////////////////////////////////////// But after submitting this page we are getting this error on the browser "Unknown request: content type is unknown " What is wrong with our code? Please rectify and reply us NB:Is nowsms support such a way of posting a parameters without the help of nowsms interface? Regards Sh | |||
Bryce Norwood - NowSMS Support (Bryce) |
Hi, Have you tried posting via an HTTP GET interface instead of the POST? Actually, I believe that I see the problem ... it looks like you might be posting to the wrong service. You need to post to the SMS gateway, not the MMSC. I think you would get that particular error message if you tried to post to the MMSC. So open your connection to the same port as is being used by the web menu interface. -bn |