1,105,592 Community Members

Error while using include in subdomain

Member Avatar
tarwara
Newbie Poster
15 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I have a domain at shared hosting which I have mapped to a folder in public html (public_html/INSURANCEGEO). Now I have created a subdomain also loacated in public html (public_html/life). Site's Header and footer files are there in 'includes' folder within my domain folder (public_html/INSURANCEGEO/includes).

I am trying to include header in my subdomain index page by writing following lines:
<?php include ('./includes/header.php'); ?>
I have also tried this also:
<?php include ('http://www.domainname.com/includes/header.php'); ?>
but same error is promting as:

Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/myhostingdomain/public_html/subdomain/index.php on line 15

Would appreciate help.

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
2
 

You need to include it with an absolute path. It's usually something like this:

include '/home/yourusername/public_html/insuranceGEO/includes/header.php';
Member Avatar
tarwara
Newbie Poster
15 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi, Thank you very much. It is working fine but is there any other alternate way because it causing problem while giving path for header image also.
It would be greate if can explain me- How programmers handle subdomain?

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

If you mean the source for an image tag (in your HTML), then you can use a full URL.

How programmers handle subdomain

There are multiple ways to do that: you can use an alias, a CDN for shared stuff, all kinds of possibilities.

Member Avatar
tarwara
Newbie Poster
15 posts since Jul 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thanks a lot dear

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article