Page 1 of 1

retriving data - urgent

Posted: 2015-02-24 12:29
by omphilesithole
Hi guys i need your help, am using appgini and i have this code that sends notifications to a mobile, now my problem is that am trying to get the data on the form, am using $title = $data['title']; but its not retrieving the whole infomartion(sentence) on that fiels it displays one word instead of the whole sentence, is the a way to call the data than the way am doing?

// Get cURL resource
$curl = curl_init();

$title = $data['title']; // it cuts the sentence
$message= $data['message']; // it cuts the sentence
$pictureurl= $data['pictureurl']; // dont retrieve at all

// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => "http://www.co-safety.co.za/dashboard/no ... pictureurl",
CURLOPT_USERAGENT => 'Codular Sample cURL Request'
));

// Send the request & save response to $resp
$resp = curl_exec($curl);

// Close request to clear up some resources
curl_close($curl);


Thanks

Re: retriving data - urgent

Posted: 2015-02-25 03:29
by udayvatturi
Hi,
Are you sure that data is getting truncated at the point of receiving only ( $data['title']) or based on the values that you are saving you are saying that.

I would recommend you to encode the data before you send the data, that may solve your issue.
Something like this

Code: Select all

CURLOPT_URL => "http://www.co-safety.co.za/dashboard/notification/sendmessage.php?".urlencode("title=".$title."&message=".$message."&pictureurl=".$pictureurl),

Re: retriving data - urgent

Posted: 2015-02-26 07:56
by omphilesithole
thank you very much the urlencode help a lot, but i had to put it on this code instead

$title = urlencode ($data['title']); // it cuts the sentence
$message= urlencode ($data['message']); // it cuts the sentence
$pictureurl= urlencode ($data['pictureurl']); // dont retrieve at all

I hope this will help others!