I have a simple Vars.php page:
<?php
//Vars.php
$WeekOfDateSelected = date('l, m/d/Y', strtotime($MonthYear));
$NextSundayOfDateSelected = date('l, m/d/Y', strtotime('this Sunday', strtotime($WeekOfDateSelected)));
?>
I have another PHP that includes Vars.php and builds a table:
<html>
<?php
//AnalyticsTest.php
include($_SERVER['DOCUMENT_ROOT']."/~/~/~/~/~/Vars.php");
function WeekTable() {
echo "<table id=\"a\">
<tr>
<th style=\"text-align: center;\"><a href=\"#\">< previous week</a></th>
<th colspan=\"4\" style=\"text-align: center;\"><h2>Week of ";
echo $WeekOfDateSelected;
echo " - ";
echo $NextSundayOfDateSelected;
echo "</th>
<th style=\"text-align: center;\"><a href=\"#\">next week ></a></th>
</tr>
</table>";
}
?>
</html>
Basically, when I call WeekTable()
everything outputs correctly except for the PHP variables $WeekOfDateSelected
and $NextSundayOfDateSelected
, which output blank.