Menu
On the top of each PHP Page, I require a config.php page.
Some of the variables on the config.php page are used in files from the includes folder.
So for my footer, I include includes/footer.php.
A variable that is in config.php is $URL.
When I echo $URL in includes/footer.php, the it does not display anything, does any one have any ideas?
Should these variables in config.php be set as global?
[code=php]$website_URL = 'http://www.mydomain.com';
<a href="<?php echo $website_URL . 'index.php'?>" title="Home">Home</a><span class="separator">|</span><a href="<?php echo $website_URL;?>dj.php" title="DJ Services">DJ Services</a><span class="separator">|</span><a href="<?php echo $website_URL;?>photoweb.php" title="Photography services">Photography services</a><span class="separator">|</span><a href="<?php echo $website_URL;?>testimonials.php" title="Client Testimonials">Client Testimonials</a><span class="separator">|</span><a href="<?php echo $website_URL;?>vendors.php" title="Preferred Vendors">Preferred Vendors</a><span class="separator">|</span><a href="<?php echo $website_URL;?>about.php" title="About Us">About Us</a><span class="separator">|</span><a href="<?php echo $website_URL;?>contact.php" title="Contact Us">Contact Us</a>[/code]
[code=php]<?php
$website_URL = "http://www.mydomain.com/new/";
$website_FULL = "/var/www/vhosts/mydomain.com/httpdocs/new/";
$website_title = "";
$right_header = "";
$clients_link = "";
$photoweb_link = "";
$event_type_enabled = "1";
?>[/code]
[code=php]
<?php require ('config.php')?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><?php echo $website_title;?></title>
<link href="<?php echo $website_URL;?>css/import.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="main">
<div id="banner"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><img src="<?php echo $website_URL;?>images/banner-1.jpg" width="43" height="117" alt="" /><img src="<?php echo $website_URL;?>images/banner-2.jpg" width="102" height="117" alt="" /></td><td><img src="<?php echo $website_URL;?>images/es-1.gif" width="335" height="23" alt="" /><br />
<img src="<?php echo $website_URL;?>images/es-2.gif" width="335" height="24" alt="SPEK" /><br /><img src="<?php echo $website_URL;?>images/es-3.gif" width="335" height="23" alt="Entertainment, the way it should be!" /><br /><img src="<?php echo $website_URL;?>images/es-4.gif" width="335" height="17" alt="Phone: 203-729-1172 — Toll free: 866-329-1172" /><br /><img src="<?php echo $website_URL;?>images/es-5.gif" width="335" height="30" alt="" /></td><td><img src="<?php echo $website_URL;?>images/banner-4.jpg" width="75" height="117" alt="" /></td><td width="396" valign="top"><img src="<?php echo $website_URL;?>images/banner-ball-1.jpg" width="396" height="52" alt="" /><img src="<?php echo $website_URL;?>images/banner-ball-2.jpg" width="396" height="12" alt="DISC JOCKEY SERVICES • EVENT PHOTOGRAPHY" /><img src="<?php echo $website_URL;?>images/banner-ball-3.jpg" width="396" height="27" alt="" /><br />
<img src="<?php echo $website_URL;?>images/top-options.jpg" width="81" height="26" alt="" /><a href="<?php echo $clients_link;?>" title="Client Login" target="_blank"><img src="<?php echo $website_URL;?>images/top-options-client.jpg" width="100" height="26" alt="Client Login" /></a><img src="<?php echo $website_URL;?>images/top-options-2.jpg" width="17" height="26" alt="" /><a href="<?php echo $photoweb_link;?>" title="Photoweb Login" target="_blank"><img src="<?php echo $website_URL;?>images/top-options-photo.jpg" width="115" height="26" alt="Photoweb Login" /></a><img src="<?php echo $website_URL;?>images/top-options-3.jpg" width="83" height="26" alt="" /></td></tr></table></div>
<div id="navBarLeft" class="left"><img style="padding-bottom: 5px;" src="<?php echo $website_URL;?>images/navBarTop.gif" width="219" height="29" alt="" /><br />
<?php include $website_URL . 'includes/navigation.php'?>
<br />
<img src="<?php echo $website_URL;?>images/menu-bottom.jpg" width="219" height="374" alt="" /></div>
<div id="content" class="left">
<div><img src="<?php echo $website_URL;?>images/content-top.gif" width="746" height="27" alt="" /></div>
<div class="txt">
<div class="leftCol left">
</div>
<div class="rightCol left">
<?php
include $website_URL . 'includes/right_column_cond.php';
switch ($event_type_enabled) {
case 0:
echo "";
break;
case 1:
include $website_URL . 'includes/eventsnav.php';
break;
}
?>
</div>
<div class="clearThis"><img class="clearThis" src="<?php echo $website_URL;?>images/content-bottom.gif" width="728" height="11" alt="" /></div>
</div>
</div>
<div id="footer">
<?php include $website_URL . 'includes/footer.php';?>
</div>
</div>
</body>
</html>
[/code]
[code=php]
include $_SERVER['DOCUMENT_ROOT'] . '/includes/filename.php';
[/code]
if you are including via URL and the file type is one which will be processed by your web server as PHP, then it is being separately parsed and executed[/QUOTE]
0.1.9 — BETA 5.18