shadowspy1 Posted June 4, 2007 Share Posted June 4, 2007 I have been stumped for days trying all sorts of different code with nothing working at all, even when someone mentioned to me that php include() was the way to go. What I am trying to do is gather information from a webpage and displaying it on mine. I have permission to do so and everything. I'm just not sure if I am on the right path here though. Quote Link to comment Share on other sites More sharing options...
chigley Posted June 4, 2007 Share Posted June 4, 2007 echo file_get_contents("http://www.google.com"); Quote Link to comment Share on other sites More sharing options...
per1os Posted June 4, 2007 Share Posted June 4, 2007 www.php.net/include notice the fopen_wrapers or something like that. If that is not on you cannot include a remote file. Try www.php.net/file_get_contents or www.php.net/file <?php $file = file_get_contents($remoteurl); echo $file; ?> Quote Link to comment Share on other sites More sharing options...
shadowspy1 Posted June 4, 2007 Author Share Posted June 4, 2007 For some reason, I've tried these options and nothing is working. Quote Link to comment Share on other sites More sharing options...
shadowspy1 Posted June 5, 2007 Author Share Posted June 5, 2007 Ok, I should probably make this more clear. I am able to do this with files on my site. However, I'm trying to open .txt files from another website onto my webpage and it isn't working? Is this the only code or am I totally missing something here? Quote Link to comment Share on other sites More sharing options...
per1os Posted June 5, 2007 Share Posted June 5, 2007 <?php phpinfo(); ?> Look through there for "allow_url_fopen" http://us2.php.net/manual/en/ref.filesystem.php#ini.allow-url-fopen See if that is enabled or not, if it is not it needs to be in order to retrieve files from remove site. Your host could have it disabled. Quote Link to comment Share on other sites More sharing options...
shadowspy1 Posted June 5, 2007 Author Share Posted June 5, 2007 It's not. I'm guessing I'm out of luck then. Quote Link to comment Share on other sites More sharing options...
per1os Posted June 5, 2007 Share Posted June 5, 2007 Do you have cURL enabled ??? You may try something like this too <?php ini_set('allow_url_fopen', true); // or "on" echo file_get_contents('http://www.google.com'); ?> www.php.net/ini_set Quote Link to comment Share on other sites More sharing options...
Dragen Posted June 5, 2007 Share Posted June 5, 2007 if you have access to your php.ini file can't you change that setting? I guess you may not have access to it anyway.. Quote Link to comment Share on other sites More sharing options...
shadowspy1 Posted June 5, 2007 Author Share Posted June 5, 2007 cURL is disabled as well. I'm going to give what you mentioned a try to see if that works. I think it is because I'm on a free account to try to get the script working and they block it because of spamming. Your suggestion doesn't work. I guess I'm going to have to pay for an account to get the full features of my site working. Quote Link to comment Share on other sites More sharing options...
per1os Posted June 5, 2007 Share Posted June 5, 2007 spamming and probably because of a huge security breach, plus its a free account, that is considered a luxury =) Quote Link to comment Share on other sites More sharing options...
shadowspy1 Posted June 5, 2007 Author Share Posted June 5, 2007 Thanks for everybody's help though. I really appreciate it and I'll just wait to get my paid hosting. Quote Link to comment 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.