We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,437 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Error while using include in subdomain

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.

2
Contributors
4
Replies
3 Hours
Discussion Span
3 Months Ago
Last Updated
5
Views
tarwara
Newbie Poster
15 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

include '/home/yourusername/public_html/insuranceGEO/includes/header.php';
pritaeas
Posting Prodigy
Moderator
9,316 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,467
Skill Endorsements: 86

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?

tarwara
Newbie Poster
15 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 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.

pritaeas
Posting Prodigy
Moderator
9,316 posts since Jul 2006
Reputation Points: 1,178
Solved Threads: 1,467
Skill Endorsements: 86

Thanks a lot dear

tarwara
Newbie Poster
15 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.3043 seconds using 2.69MB