[GH-ISSUE #147] fail to get data through http post #112

Closed
opened 2026-02-28 01:23:14 +03:00 by kerem · 8 comments
Owner

Originally created by @emollusion on GitHub (Mar 3, 2014).
Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/147

I have been working back and forth with the log in smssync for a while now but seems to get stuck at the same place.

I cant get any data when using post.

Example of line:
if(isset($_POST['secret'])){$secret = $_POST['secret'];}

And in the smssync config it has the same spelling, use of POST and JSON.

PHP error is undefined variable, and in the JSON output error message is 'no secret'.

I am lost...

Phone is Fairphone 1, android 4.2.2
Smssync is latest fr play store.

Server is Lighttp and php under android, so running the server locally on the phone.

Smssync still needs to be connected to the internet to try to sync locally, which is sad but not really a problem.

Any help?

Originally created by @emollusion on GitHub (Mar 3, 2014). Original GitHub issue: https://github.com/ushahidi/SMSSync/issues/147 I have been working back and forth with the log in smssync for a while now but seems to get stuck at the same place. I cant get any data when using post. Example of line: if(isset($_POST['secret'])){$secret = $_POST['secret'];} And in the smssync config it has the same spelling, use of POST and JSON. PHP error is undefined variable, and in the JSON output error message is 'no secret'. I am lost... Phone is Fairphone 1, android 4.2.2 Smssync is latest fr play store. Server is Lighttp and php under android, so running the server locally on the phone. Smssync still needs to be connected to the internet to try to sync locally, which is sad but not really a problem. Any help?
kerem closed this issue 2026-02-28 01:23:14 +03:00
Author
Owner

@eyedol commented on GitHub (Mar 3, 2014):

On the server side, the way you're getting the post value is wrong. It should be

if(isset($_POST['secret'])){$secret = $_POST['secret'];}

SMSSync doesn't need to be connected to the internet to access the local web service. It has to be on the same network as the local web service.

<!-- gh-comment-id:36476616 --> @eyedol commented on GitHub (Mar 3, 2014): On the server side, the way you're getting the post value is wrong. It should be `if(isset($_POST['secret'])){$secret = $_POST['secret'];}` SMSSync doesn't need to be connected to the internet to access the local web service. It has to be on the same network as the local web service.
Author
Owner

@emollusion commented on GitHub (Mar 3, 2014):

I might have done to much programming last few nights but I can't see any diffrence between the two lines.

And smssync appears to need a dataconnwction, the log says No Active Data Connection while connecting to the local server without data connection (wan).

<!-- gh-comment-id:36501212 --> @emollusion commented on GitHub (Mar 3, 2014): I might have done to much programming last few nights but I can't see any diffrence between the two lines. And smssync appears to need a dataconnwction, the log says No Active Data Connection while connecting to the local server without data connection (wan).
Author
Owner

@eyedol commented on GitHub (Mar 4, 2014):

@markusm there is difference between if(isset($_POST['secret'])){$secret = $_POST['secret'];} and if(isset($POST['secret'])){$secret = $POST['secret'];} Look at the two carefully.

You don't need internet to post locally.

<!-- gh-comment-id:36586613 --> @eyedol commented on GitHub (Mar 4, 2014): @markusm there is difference between `if(isset($_POST['secret'])){$secret = $_POST['secret'];}` and `if(isset($POST['secret'])){$secret = $POST['secret'];}` Look at the two carefully. You don't need internet to post locally.
Author
Owner

@emollusion commented on GitHub (Mar 4, 2014):

Ok. I see the difference now.
But according to both the manual on smssync and php.net
http://smssync.ushahidi.com/developers/
http://www.php.net/manual/en/reserved.variables.post.php

To get form data through post method use &_POST.

In other words, your tip didnt work.

And yes, I need wan connection for smssync to sync. Otherwise the log doesnt say anything, and the app doesnt even give me fail or success.

<!-- gh-comment-id:36617563 --> @emollusion commented on GitHub (Mar 4, 2014): Ok. I see the difference now. But according to both the manual on smssync and php.net http://smssync.ushahidi.com/developers/ http://www.php.net/manual/en/reserved.variables.post.php To get form data through post method use &_POST. In other words, your tip didnt work. And yes, I need wan connection for smssync to sync. Otherwise the log doesnt say anything, and the app doesnt even give me fail or success.
Author
Owner

@emollusion commented on GitHub (Mar 6, 2014):

Why did this get closed?

<!-- gh-comment-id:36836189 --> @emollusion commented on GitHub (Mar 6, 2014): Why did this get closed?
Author
Owner

@kizomanizo commented on GitHub (Sep 18, 2018):

You were quite a bully

<!-- gh-comment-id:422271612 --> @kizomanizo commented on GitHub (Sep 18, 2018): You were quite a bully
Author
Owner

@jesseperexc commented on GitHub (Sep 18, 2018):

What

On Sep 18, 2018 1:32 AM, "Bwana Kizito" notifications@github.com wrote:

You were quite a bully


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/ushahidi/SMSSync/issues/147#issuecomment-422271612,
or mute the thread
https://github.com/notifications/unsubscribe-auth/An5J09WuJ45OItIQcnttWXJrfrOvUYajks5ucJNngaJpZM4BmLFC
.

<!-- gh-comment-id:422273234 --> @jesseperexc commented on GitHub (Sep 18, 2018): What On Sep 18, 2018 1:32 AM, "Bwana Kizito" <notifications@github.com> wrote: > You were quite a bully > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub > <https://github.com/ushahidi/SMSSync/issues/147#issuecomment-422271612>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/An5J09WuJ45OItIQcnttWXJrfrOvUYajks5ucJNngaJpZM4BmLFC> > . >
Author
Owner

@kizomanizo commented on GitHub (Sep 18, 2018):

I commented on a 4 year old thread. Landed on it as I was looking on a proper JSON schema to test get_messace method.

<!-- gh-comment-id:422275354 --> @kizomanizo commented on GitHub (Sep 18, 2018): I commented on a 4 year old thread. Landed on it as I was looking on a proper JSON schema to test get_messace method.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SMSSync#112
No description provided.