f1p2 Posted February 1, 2012 Posted February 1, 2012 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
anush Posted February 1, 2012 Posted February 1, 2012 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
f1p2 Posted February 2, 2012 Author Posted February 2, 2012 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 Googledfor 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.
anush Posted February 3, 2012 Posted February 3, 2012 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.
Ice IT Support Posted February 3, 2012 Posted February 3, 2012 HelioHost does not allow the including of external scripts (from other servers) for security reasons.
Byron Posted February 4, 2012 Posted February 4, 2012 You could use an iframe. Not quite the same as include, but maybe what you need.
anush Posted February 4, 2012 Posted February 4, 2012 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
Byron Posted February 4, 2012 Posted February 4, 2012 It would need to be something like this: <?php include("/home/username/public_html/folder/page.php"); ?>
Piotr GRD Posted February 4, 2012 Posted February 4, 2012 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.
mindstorm8191 Posted April 19, 2012 Posted April 19, 2012 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.
anush Posted June 2, 2012 Posted June 2, 2012 Thank you @mindstorm8191, i never thought of that idea.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now