Jump to content

Include other website


shadowspy1

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.