note 106108 added to function.file-get-contents

From: Date: Tue, 11 Oct 2011 11:16:38 +0000
Subject: note 106108 added to function.file-get-contents
Groups: php.notes 
Request: Send a blank email to php-notes+get-183780@lists.php.net to get a copy of this message
I experienced a problem in using hostnames instead straight IP with some server destinations. If i use file_get_contents("www.jbossServer.example/app1",...) i will get an 'Invalid hostname' from the server i'm calling. This is because file_get_contents probably will rewrite your request after getting the IP, obtaining the same thing as : file_get_contents("xxx.yyy.www.zzz/app1",...) And you know that many servers will deny you access if you go through IP addressing in the request. With cURL this problem doesn't exists. It resolves the hostname leaving the request as you set it, so the server is not rude in response. ---- Server IP: 69.147.83.197 Probable Submitter: 88.55.96.248 ---- Manual Page -- http://www.php.net/manual/en/function.file-get-contents.php Edit -- https://master.php.net/note/edit/106108 Del: integrated -- https://master.php.net/note/delete/106108/integrated Del: useless -- https://master.php.net/note/delete/106108/useless Del: bad code -- https://master.php.net/note/delete/106108/bad+code Del: spam -- https://master.php.net/note/delete/106108/spam Del: non-english -- https://master.php.net/note/delete/106108/non-english Del: in docs -- https://master.php.net/note/delete/106108/in+docs Del: other reasons-- https://master.php.net/note/delete/106108 Reject -- https://master.php.net/note/reject/106108 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#183780) next »