Page 1 of 1

php template problems

Posted: Wed Apr 30, 2008 7:14 am
by ozziepom
I have recently been assigned to update a sporting club website. We have a php template building from headtag, sidetag etc. For years the all the pages displayed perfectly, now the following 'if else' and 'include' statement seems to be failing.

<?php
if(!$page) {
include("/home/name/public_html/content/xyznews.php");
}
else{
include("/home/name/public_html/content/" . "$page" . ".php");
}
?>

It seems OK to me, but beating my head over why 'xyznews.php' page keeps displaying when selecting other pages on the site. Or is this a problem with the hosting provider?

Re: php template problems

Posted: Wed Apr 30, 2008 10:46 am
by N1gel
The If looks ok.

If you want to know why it always shows xyznews.php try printing out $page before the if statment and see what it looks like. Your problem could be somewhere else in your code