$_POST when receiving SMS doesnt work | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through August 22, 2012 ⬆ |
◄ ► |
Author | Message | |||
arun kumar.S New member Username: Arunsonim Post Number: 1 Registered: 04-2012 |
Hi All, I am trying to receive SMS at a particular web location. When receiving I am trying to use PHP's $_POST method to receive the parameters from SMS. However I am not able to receive it. $_GET works fine.But I cannot use $_GET for long messages. So kindly help me with the above issue. Details for Received SMS Command Table under 2-Way option, SMS Command Prefix: DMP Command to execute: http://<my web address>/index.php?msisdn=@@SENDER@@&message=@@SMS@@&message_id=@@MESSAGEID@@ Please help me out.... | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 3928 Registered: 08-2008 |
Hi, $_GET is used to parse variables from HTTP GET requests, and $_POST is used to parse variables from HTTP POST requests. (Or, I usually recommend using $_REQUEST which works for either type of request.) NowSMS 2-way commands always use HTTP GET. So you will never see any data in a $_POST variable. NowSMS can support a URL length of up to 4096 characters in an HTTP GET 2-way command. However, you are correct that some web server environments may truncate at a shorter length. What size limit are you experiencing? I discussed this issue with our engineering team earlier today, and one of our engineers had a good idea for how we could add an option for HTTP POST support in an update. I will post an updated version with this support next week.' For now, I am curious what size limit you are encountering, and what version of NowSMS you are using. -- Des NowSMS Support | |||
arun kumar.S New member Username: Arunsonim Post Number: 2 Registered: 04-2012 |
Hi Des, Actually the issue was from my php code. It was trimming long parameter values - It was a BUG :( I got it working. Thank you for your so quick response and support. However it would be better to use $_POST rather $_GET because our data sent will be secure (Not know to the outside world). Hope you will update me with the latest version soon. I use NOW SMS/MMS v2011.07.05 version. I am using the trial version to test SMSNOW gateway. Our company might even upgrade to paid version if we find it good for our project. Thanks again and please help me with the $_POST issue.... | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 3934 Registered: 08-2008 |
Hi Arun, I'm glad you were able to find the problem. We're going to produce an update where if you start a 2-way command with httppost:// or httpspost:// ... it will send the variables after the "?" as POST data instead of GET. I'm not sure that $_POST is any more secure than $_GET unless you're using SSL. But I guess you have a point that a hosting provider might be logging GET parameters but not POST. -- Des NowSMS Support | |||
arun kumar.S New member Username: Arunsonim Post Number: 3 Registered: 04-2012 |
Hi Des, So you mean that if I use a URL in the "command to execute" for 2-way SMS, I have to start the URL has httppost://<web_addr>/index.php?param=value. Right? Correct me if I am wrong. Regards, Arun | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 3935 Registered: 08-2008 |
Hi Arun, In the next update (not in current versions), yes. -- Des NowSMS Support | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 3947 Registered: 08-2008 |
Hi Arun, A follow-up ... we did push out an update that can use HTTP POST for a 2-way command like I explained earlier in this thread. The update can be downloaded at http://www.nowsms.com/download/nowsms20120501.zip. -- Des NowSMS Support | |||
arun kumar.S New member Username: Arunsonim Post Number: 4 Registered: 04-2012 |
Hi Des, You are just great. Thank you for such a wonderful support and a wonderful update. The POST works good. Regards, Arun | |||
arun kumar.S New member Username: Arunsonim Post Number: 5 Registered: 04-2012 |
Hi Des, I have few doubts with the SMS Command Prefix in 2-Way SMS tab. Currently I use SIGN URL_OF_MY_WEBSITE, where SIGN is "SMS Command Prefix". So I should be sending SMS as "SIGN SONIM_MESSAGES". However if I send SIGN_SONIM_MESSAGES, the "SMS command Prefix" is not identified by NOWSMS and hence the incoming SMS is not submitted to the given URL. Kindly help me with this issue. Regards, Arun kumar S} | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 4028 Registered: 08-2008 |
Hi, That is correct. If you want to capture SIGN_some_text, configure a prefix of SIGN* The * acts as a wild card to match 0 or more characters. -- Des NowSMS Support |