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. Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/ 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"); Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-267689 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; ?> Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-267690 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. Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-267727 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? Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268774 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. Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268782 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. Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268790 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 Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268793 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.. Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268794 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. Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268795 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 =) Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268797 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. Link to comment https://forums.phpfreaks.com/topic/54145-include-other-website/#findComment-268798 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.