Hi,
I have footer.php file in my wpA site and file.php in my wpB website.
...
-
How to Include External PHP File into footer.php
Hi,
I have footer.php file in my wpA site and file.php in my wpB website.
I want to include file.php into footer.php
i've tried include = 'http://websiteB/file.php' and gets me this error
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /path_to/
websiteA/
footer.php
I've looked over google and couln't find any trick to solve this ..
I'm thinking rewriting the function.php might work .. but i don't know what to write there ...
I'd appreciate some help on this ..
Last edited by Claudiu; 03-31-2010 at 08:26 AM.
-
-
-
Re: How to Include External PHP File into footer.php
You should use the full path instead of the url in include. So add include("/pathto/websiteb/file.php"); incase websiteb is hosted somewhere else you should copy file.php file to websiteA's folder.
-
-
Re: How to Include External PHP File into footer.php
Some Hosts do not allow this kind of includes.
-
-
Re: How to Include External PHP File into footer.php
usually hosts won't allow including externally hosted files.
-
-
Re: How to Include External PHP File into footer.php
you should allow base_url module, btw including php files from external sources is a risky practice most servers wouldn't allow when running sharing enviroments
you better use javascript or, depending on the content of file.php, some scraping tool
-
-
Re: How to Include External PHP File into footer.php
you could try using an iframe.
include, require and require_once will work if you are including from the same server.
-
-
Re: How to Include External PHP File into footer.php
i appreciate your input guys, but it was kinda obvious that i can't use the include as i've posted the include error i got .. anyway .. problem solved with another turnaround trick ..
for those having similar problem google for - fopen read external file -
-
-
Re: How to Include External PHP File into footer.php
use this eval(file_get_contents($file));
-
-
Re: How to Include External PHP File into footer.php
Just create a link in your footer to a blank php page, with a header ( ); redirect function to the offer site page leading to your desired target file/source.
All you do is:
1. Create a new php page and add it to your site, with the following link in the source code:
<?php
header("Location: http://www.your-target-link.here");
?>
2. Create the link in your site footer to this new php page you've just created, within your current site that the visitor with land on.
They will click the link in the footer and it will take them instantly to the offsite page where whatever file, zip, page, etc. you want to have popup.
You don't have to worry about the hosts not approving the redirect, as it is standard php practice. However, you do have to be aware of whatever content the visitor is getting on the other end of that link, as it will get you shut down, should it be something unethical. To each their own, just not my bag.
Last edited by aftershock2020; 03-31-2010 at 05:08 PM.
-
-
Re: How to Include External PHP File into footer.php
Use the following.
PHP Code:
<?php include($_SERVER['DOCUMENT_ROOT'].'/file.php'); ?>
-
-
Re: How to Include External PHP File into footer.php
Server fopen function is disabled. try including java file and wrote code at java script, then run java from footer.
-
-
Re: How to Include External PHP File into footer.php

Originally Posted by
smashedpumpkins
Use the following.
PHP Code:
<?php include($_SERVER['DOCUMENT_ROOT'].'/file.php'); ?>
this is not for linking externally (see title)
-
-
Re: How to Include External PHP File into footer.php

Originally Posted by
Claudiu
i appreciate your input guys, but it was kinda obvious that i can't use the include as i've posted the include error i got .. anyway .. problem solved with another turnaround trick ..
for those having similar problem google for - fopen read external file -
for anyone else that needs to know how to do this, it depends on your server's php.ini configuration. Most will have this function disabled; however on hostgator, surprisingly they have the variable set to on, and this is in shared hosting!!!
search this in your php.ini file:
if it is set like this :
Code:
allow_url_include = Off
set it to "On" and save the php.ini
hope this helps
-
-
Re: How to Include External PHP File into footer.php
Oh, and I will tell you this from experience, if your host is Godaddy, you don't have access to the php.ini file, AND fopen is disabled so you would definitely have to find a workaround. Java sound like a viable alternative, I will check it out.
peace
-
Similar Threads
-
By c0ck in forum BlackHat Lounge
Replies: 0
Last Post: 11-13-2008, 03:42 PM
-
By theadultsplayground in forum Blogging
Replies: 3
Last Post: 07-04-2008, 06:20 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks