Jump to content

Recommended Posts

Posted

Hi there,

 

Whilst attempting to make some of my code easier to read I decided to adopt a modular approach and use the include() function to include portions of code I might reuse in separate files.

 

When I use an include with a local file (ie:relative to the root directory) the code is included into the calling script as expected.When I try to include a file on another server by including the domain, path and filename in the include function all I get is a blank page.

I did read somewhere that in some instances it's necessary to add some configure information to the configure file when you want to include from files on another server. Does anyone know if this is needed on heliohost or whether external includes have been disabled ?

 

Thanks in advance for any help :)

Posted

You can change the permission of the file to 777.

so it give execute right to user .

 

i have not tried this before,

please tell if this worked

Posted

Thank you for the suggestion. Sorry I didn't reply earlier. I was waiting for Stevie to regain consciousness. Anyway.. I changed the permissions and still get a blank page. As I mentioned before.. it works if I include the file on the same server.

 

I also double checked the file path. I know it's correct because it works if I paste it directly into the address bar.

Finally I also tried using..

 

ini_set('allow_url_include','on');

 

Apparently this needs to be set in some instances and I'm not sure if this is where the problem lays.

I don't know much about ini files but I'm also wondering if heliohost have just disabled allow url include because when I Googled

for help I found another post with another host provider where this feature has been disabled.

 

Thanks in advance to all you kind people for any more suggestions.

Posted

that is Ok ,if it does not works then i think you must wait for heliohost admin to answer this,because i don't know whether it is disabled on the server.

Posted

Can we use include for a file on a sub domain in a web site hosted on same server of heliohost

 

i mean can i use

 

<?php
include('http://head.websitename.org/page.php');
?>

 

the web site is in Stevie

Posted

This is NEVER safe to include data from external source.

But if someone need to get the data from external source and use it, then there is another way. Get the data with using cURL or fsockopen() functions for example and then use it. If it's HTML then simply echo the code, if it's PHP code then do the eval() on it. Either way - especially if someone wants to eval() some PHP code - It's highly recommended to do some data verification before, for being sure that there is expected, valid and safe data on that external server.

  • 4 weeks later...
  • 1 month later...
  • 2 weeks later...
Posted

Anush, I don't mean to ignore the original question, but why can't you simply move the file onto your own website? If its something that gets updated frequently, you could write a version-check type thing that can re-download the file from the source (ensuring authorized access at the same time) and then include it. Piotr is probably right, its very dangerous to be including files from another server.

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...