$_POST when receiving SMS doesnt work

$_POST when receiving SMS doesnt work SearchSearch

SMS & MMS Technical Forum » NowSMS Support - SMS Issues (Product Support Only) » Archive through August 22, 2012 » $_POST when receiving SMS doesnt work « Previous || Next »
Author Message
arun kumar.S
New member
Username: Arunsonim

Post Number: 1
Registered: 04-2012
Posted on Thursday, April 26, 2012 - 07:52 am:   

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
Posted on Thursday, April 26, 2012 - 08:49 pm:   

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
Posted on Friday, April 27, 2012 - 07:55 am:   

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
Posted on Friday, April 27, 2012 - 08:15 pm:   

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
Posted on Monday, April 30, 2012 - 04:48 am:   

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
Posted on Monday, April 30, 2012 - 03:22 pm:   

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
Posted on Wednesday, May 02, 2012 - 07:09 pm:   

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
Posted on Thursday, May 03, 2012 - 04:57 am:   

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
Posted on Tuesday, July 10, 2012 - 04:13 am:   

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
Posted on Tuesday, July 10, 2012 - 02:02 pm:   

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

Login Login / Register Logout Logout Search Last 30 Days Topics Topics