
I have tried to send data in php with a Plus (+) sign. When i send the data using a $_post it replaces Plus(+) with a space how can i make this work *sample script* * $url = "http://www.samplesite.ke/receive.php"; $account=123; $values="this is blood group B+ with rhesus factor"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $account); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"account=". $account."&val=".$values. "); $result= curl_exec ($ch); curl_close ($ch); **the result recieved is * *this is blood group B with rhesus factor*

This is a long shot, but you can try using single quotes thus: *$values='this is blood group B+ with rhesus factor';* On Mon, Apr 16, 2012 at 4:40 PM, Isaac Kimotho <izakimotho@gmail.com> wrote:
I have tried to send data in php with a Plus (+) sign. When i send the data using a $_post it replaces Plus(+) with a space how can i make this work
*sample script* * $url = "http://www.samplesite.ke/receive.php"; $account=123; $values="this is blood group B+ with rhesus factor"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $account); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"account=". $account."&val=".$values. "); $result= curl_exec ($ch); curl_close ($ch);
**the result recieved is *
*this is blood group B with rhesus factor*
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Regards, Peter Karunyu -------------------

On Mon, Apr 16, 2012 at 4:40 PM, Isaac Kimotho <izakimotho@gmail.com> wrote:
I have tried to send data in php with a Plus (+) sign. When i send the data using a $_post it replaces Plus(+) with a space how can i make this work
sample script
$url = "http://www.samplesite.ke/receive.php"; $account=123; $values="this is blood group B+ with rhesus factor"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $account); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"account=". $account."&val=".$values. "); $result= curl_exec ($ch); curl_close ($ch);
the result recieved is
this is blood group B with rhesus factor
You may want to URL encode [1] the data before sending it. Probably using the urlencode function: <http://php.net/manual/en/function.urlencode.php>. As a bonus, you can also use this service for debugging: <http://httpbin.org/>. [1] <http://en.wikipedia.org/wiki/Percent-encoding> Joseph.

You need to urlencode and urldecode the values On Monday, April 16, 2012, Isaac Kimotho wrote:
I have tried to send data in php with a Plus (+) sign. When i send the data using a $_post it replaces Plus(+) with a space how can i make this work
*sample script* * $url = "http://www.samplesite.ke/receive.php"; $account=123; $values="this is blood group B+ with rhesus factor"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $account); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"account=". $account."&val=".$values. "); $result= curl_exec ($ch); curl_close ($ch);
**the result recieved is *
*this is blood group B with rhesus factor*

+one on encoding / decoding the URL On Mon, Apr 16, 2012 at 7:45 PM, Rad! <conradakunga@gmail.com> wrote:
You need to urlencode and urldecode the values
On Monday, April 16, 2012, Isaac Kimotho wrote:
I have tried to send data in php with a Plus (+) sign. When i send the data using a $_post it replaces Plus(+) with a space how can i make this work
*sample script* * $url = "http://www.samplesite.ke/receive.php"; $account=123; $values="this is blood group B+ with rhesus factor"; $ch = curl_init(); curl_setopt($ch, CURLOPT_USERAGENT, $account); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS,"account=". $account."&val=".$values. "); $result= curl_exec ($ch); curl_close ($ch);
**the result recieved is *
*this is blood group B with rhesus factor*
_______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke ------------ List info, subscribe/unsubscribe http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------
Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
participants (5)
-
Hubert Sentwali
-
Isaac Kimotho
-
Joseph Wayodi
-
Peter Karunyu
-
Rad!