I have a page that works off of switches, I want the $page_title variable to show up with in a function, but I can't seem to make it work:
<?
$page_title ="Video Clips"; // This needs to show in functions when printing to browser
function show_categories()
{
open_table_main();
echo "<TR><TH>".$page_title."</TH></TR>\n";
$query = "select category from rpg_cat_videos ORDER BY catid asc";
$result = mysql_query($query);
$num_results = mysql_num_rows($result);
$i = 0;
while($row = mysql_fetch_array($result))
{
$bgcolor = ($i++ & 1) ? '#eeeeee' : '#ffffff';
echo "<TR><TD>";
echo "<A HREF=\"".$PHP_SELF."?func=title\">";
echo stripslashes($row["category"]);
echo "</A>";
echo "</TD></TR>\n";
}
close_table_main();
}
//.....
switch($func) {
default:
show_categories();
break;
case "title":
show_titles();
break;
case "clip":
play_clip();
break;
}
?>
But when I view the source through the browser, I see the page title and the $PHP_SELF name don't appear either, looks like this:
<TABLE WIDTH="100%" CELLSPACING="2" CELLPADDING="2" BORDER="0" BGCOLOR="">
<TR><TH> </TH></TR>
<TR><TD><A HREF=" ?func=title">Category I</A></TD></TR>
<TR><TD><A HREF=" ?func=title">Category II</A></TD></TR>
<TR><TD><A HREF=" ?func=title">Category III</A></TD></TR>
<TR><TD><A HREF=" ?func=title">Category IV</A></TD></TR>
<TR><TD><A HREF=" ?func=title">Category V</A></TD></TR>
<TR><TD><A HREF=" ?func=title">Category VI</A></TD></TR>
<TR><TD><A HREF=" ?func=title">Miscellenous</A></TD></TR>
</TABLE>
What am I doing wrong here?