Exec PHP API

Read 7126 times
I need help to exec the URL from PHP.

I have de URL http:/IP:2199/api.php?xm=server.stop&f=json&a[username]=test&a[password]=test

If I go to this url in the browser, it works. But, I cannot make it works in PHP.

Someone have an example code?

Thanks!
<?php
simplexml_load_file('http:/IP:2199/api.php?xm=server.stop&f=json&a[username]=test&a[password]=test' );
?>
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
same problem for me (simplexml_load_file) only run on same server, i need run php script on external hosting server
It may be disabled on your web server,

allow_url_fopen needs to be on in your php.ini

OR you can also use CURL.

http://stackoverflow.com/questions/11553678/read-xml-data-from-url-using-curl-and-php
Last Edit: June 27, 2016, 07:43:30 am by My Auto DJ
My Auto DJ
Orlando, FL USA
Quality SHOUTcast Hosting http://myautodj.com
SHOUTcast Widgets http://shoutcastwidgets.com
allow_url_fopen is enabled on webserver and centovacast server
im test with CURL from web server to http://micentovahost.com and works but when test from web server to http://micentovahost.com:2199/api.php it dont connect, 2199 por is open on server firewall but dont reply

if i use XMLHttpRequest this works but i need to het working with PHP