clonetrooper9494 Posted February 15, 2008 Share Posted February 15, 2008 Can you get data outputted by a different domain using file() and include()? or do the sites block that? Link to comment Share on other sites More sharing options...
jhecht Posted February 15, 2008 Share Posted February 15, 2008 depending on your server, it is possible to get it with the file() function. Don't know about the include function, but i don't believe so. the file() thing will only work(i believe) if the PHP fsock option is enabled. Link to comment Share on other sites More sharing options...
AElliott Posted February 15, 2008 Share Posted February 15, 2008 Yes, you can, include does work if allow_url_fopen is set to true - but it comes with a serious security risk since with include whatever you get back will be interpreted as PHP and run on your server. Thus, if they can modify the URL, or can change the contents of the remote file to include PHP they can execute arbitrary code on your server.So, file(), file_get_contents() and similar are better choices, since they do not carry this risk. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.