Help - Search - Members - Calendar
Full Version: damn php includes..
Forums > Resource Center > Webmasters' Corner > Webmasters' Corner Resolved Topics
technicolour
K, I got rehosted, and I honest to God can not get my stupid php includes to work.

My OLD include was:

QUOTE
<?include ("http://elegance.foreverbliss.org/header.php"); ?>


Which calls for my OLD HEADER, which was:

QUOTE
<?php require('/home2/asweetap/public_html/elegance/wordpress/wp-blog-header.php'); ?>
<?php get_header(); ?>


My host tried changing it to:

QUOTE
<?include ("/home/.festus/classique/classique.impersonal.tv/header.php"); ?>


But, that doesn't work either.

I just need some gosh darn php help. Completely.
freeflow
See that is why I build the whole site in wordpress.

Anyways you tried doing it the first way by linking it before doing this:
<?include ("/home/.festus/classique/classique.impersonal.tv/header.php"); ?> ?

This probably won't make a diff but you can try spacing <? and include. It probably won't do anything at all though.
Like
<? include("dooooobydoobydoob");?>
mipadi
Use relative links. For example, if the file exists in the same directory, just use:
CODE
<?php include('header.php'); ?>
.

Or specify it relative to the webserver by placing a / in the front. For example, if the include exists at http://www.blah.com/includes/header.php, include it like this:
CODE
<?php include('/includes/header.php'); ?>
.

(As a tiny, minor side note, if your path doesn't contain a PHP variable, it's more efficient to use single quotes rather than double quotes.)
technicolour
NEVERMINDDD! I got it. Thank you both for your help. I was stupid and I didn't have my url to the right thing. Had to go through /blah/blah/blah like 8 times.

Thank you once againnnn!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.