HELLO, i have to run this url inside my script to ensure the moving of listners from a station to another.. file_get_contents('http://user:pass@mywebsite.com:8000/admin/moveclients.xsl?mount=/radio&destination=/serveur'); Code (markup): But it gives this error : Warning: file_get_contents ..... HTTP/1.1 400 Bad Request when tying with another URL for example file_get_contents('http://www.google.com'); it work without any problem.. i think the probleme come from the authentification [url]http://user:pass@mywebsite.com[/url] Code (markup): .
The problem could also be from the port 8000 or the .xls extension. If the page truly validates a user based on the url, then file get contents should still work. In that case the .xls or the :8000 are where I'd be concerned. You may try using curl instead of file_get_contents. It's quite a bit more complicated but it has much more advanced functionality. Also, you may need to urlencode part of the url to get file_get_contents to work properly.
Hello the probleme doesn't come from the port :8000 because its working like that : http://www.xxx.com:8000 also URL encoding didn't work for me.
I think you need to use stream_context_create function. Here is the code example from manual: $url = 'http://protectedstuff.com'; $auth = base64_encode('user:password'); $header = array("Authorization: Basic $auth"); $opts = array( 'http' => array ('method'=>'GET', 'header'=>$header)); $ctx = stream_context_create($opts); echo file_get_contents($url,false,$ctx); PHP: