http_post_data problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kanuvas
Forum Newbie
Posts: 2
Joined: Fri Oct 31, 2008 11:08 am

http_post_data problem

Post by kanuvas »

Hi All,

I am trying to pass a bit of XML to a web address using http_post_data.

Firstly I have PHP setup by my internet provider but no extensions setup. I assume using this function doesn't require an extension?

Basically the below code is what I am using though it doesn't work.

Code: Select all

 
<?php
 
$xml = '<?xml version="1.0" encoding="UTF-8"?\>
 <person>
   <method>sendtheitem.link</method>
   <serviceid>345346</serviceid>
   <params>
     <msisdn>3526276347232</msisdn>
     <operator>34634634</operator>
     <country>GB</country>
     <lang>en</lang>
     <content>games</content>
     <Type>wap<Type>
   </params>
 </person>      ';
 
 
$response = http_post_data("http://webapp.hidden.net/esp/18UY14/w2m.esp",$xml);
 
?>
 
 
This displays the following error:
Fatal error: Call to undefined function: http_post_data() in /data/httpd/onlinegames/data/testweb/onlinegames.php on line xx

Anyone got any idea what I am doing wrong and how to rectify it?

Much appreciated

Simon
youropensource
Forum Commoner
Posts: 26
Joined: Tue Aug 05, 2008 11:42 am

Re: http_post_data problem

Post by youropensource »

Hello kanuvas,

you need to installed the ( PECL pecl_http:0.1.0-1.5.5 ) components on your server. Once you have installed on your server, you got the result.

Ref: http://in.php.net/http_post_data
youropensource.com
kanuvas
Forum Newbie
Posts: 2
Joined: Fri Oct 31, 2008 11:08 am

Re: http_post_data problem

Post by kanuvas »

Hi,

Thanks very much for this I will install the extension and try again.

Cheers

Simon
Post Reply