mickwaffle Posted July 12, 2009 Share Posted July 12, 2009 hello is it possible to get the body of a url on port 8080 using file_get_contents? currently does not work for me Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/ Share on other sites More sharing options...
MadTechie Posted July 12, 2009 Share Posted July 12, 2009 you mean like this file_get_contents('http://domain.com:8080'); ? Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874146 Share on other sites More sharing options...
mickwaffle Posted July 12, 2009 Author Share Posted July 12, 2009 ye like that.. but it doesn't seem to work for me Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874164 Share on other sites More sharing options...
Daniel0 Posted July 12, 2009 Share Posted July 12, 2009 How doesn't it work? The universe implodes, or...? Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874165 Share on other sites More sharing options...
mickwaffle Posted July 12, 2009 Author Share Posted July 12, 2009 look at this : http://supergames365.com/server_check.php?url=http://streams.nxtek.net:8000/index.html which is code is this: $url=$_GET['url']; $homepage = file_get_contents($url); echo $homepage; Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874168 Share on other sites More sharing options...
Daniel0 Posted July 12, 2009 Share Posted July 12, 2009 I don't hope you intend to keep it like that. You just allowed me to read a series of sensitive files on your server. Well, literally any file that the web server has access to. Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874180 Share on other sites More sharing options...
WolfRage Posted July 12, 2009 Share Posted July 12, 2009 lol, that was fun, never do that again. Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874185 Share on other sites More sharing options...
mickwaffle Posted July 12, 2009 Author Share Posted July 12, 2009 haha.. you probobly looked at the config.php file didn't you ...lol anyway.. any ideas how to fix? Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874186 Share on other sites More sharing options...
WolfRage Posted July 12, 2009 Share Posted July 12, 2009 Alright so what was the error again? I did not actually take the time to read the error? Also why do you need to get this page on this specific port instead of the standard port? Does the page really exists? Why not use CURL to get the page? Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874190 Share on other sites More sharing options...
mickwaffle Posted July 12, 2009 Author Share Posted July 12, 2009 http://supergames365.com/server_check.php it is not my page.. i need to access it as it is.. someone else has me accessing it for them.. its theirs Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874198 Share on other sites More sharing options...
WolfRage Posted July 12, 2009 Share Posted July 12, 2009 Ok well it is currently stating that it failed to open a stream to the server and you are using the standard port of 80. I thought you were using a different port? Is the code that you posted is that all of it? Also you should note that it appears that the request really is working, but there is a proxy buffer in between you and the proxy. [iCY 200 OK] almost always indicates that there is an HTTP proxy involved. Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874226 Share on other sites More sharing options...
mickwaffle Posted July 12, 2009 Author Share Posted July 12, 2009 ahhh i understand... the php script is recieving a music stream from the URL... how do i trick the server into thinking that it is infact a web-browser pinging it and not a php script? must i play with headers? Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874230 Share on other sites More sharing options...
WolfRage Posted July 13, 2009 Share Posted July 13, 2009 CURL is your best bet for this kind of request. http://www.php.net/curl Quote Link to comment https://forums.phpfreaks.com/topic/165712-using-file_get_contents-on-differnt-ports/#findComment-874314 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.