Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

PhatNav Single Page PHP Navigation

Code Wizard, 12-30-2006

This is a simple series of files which i have used time and time again. As I say this is a basic structure and can be widely extended, this has been taken straight out of a live templated site. The format that Is used can be easily Integrated with a DB.

the end result of your navigation, which I think a lot of people were asking for is e.g http://www.yoursite.com/index.php?sectionName=home etc etc..

It is easy enough to pull the relevant bits out, and intergrate with your own HTML.

Any questions contact me - Phatman [phatman@phirus.com]

<?

/*
E-mail: phatman@phirus.com :)
All rights reserved.

this is version 1.0 of a script that i will update from time to time if necessary.

this code is published under the concept of opensource, it can be freely used
and even changed.

*/

?>

[index.php]
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

<?
$ip = $REMOTE_ADDR;
$date = date( "l, F j Y, h:i a");

$menu_list=array("home","php","jscript","html","ja va","flash","ascript","css","news","forum","links" ,"chat","tutorial","contact","staff");

$title_list["home"]="Y o u r s i t e . c o m - home";
$title_list["php"]="Y o u r s i t e . c o m - php";
$title_list["jscript"]="Y o u r s i t e . c o m - javascript";
$title_list["html"]="Y o u r s i t e . c o m - html";
$title_list["java"]="Y o u r s i t e . c o m - java";
$title_list["flash"]="Y o u r s i t e . c o m - flash";
$title_list["ascript"]="Y o u r s i t e . c o m - actionscript";
$title_list["css"]="Y o u r s i t e . c o m - css";
$title_list["news"]="Y o u r s i t e . c o m - news";
$title_list["forum"]="Y o u r s i t e . c o m - forum";
$title_list["links"]="Y o u r s i t e . c o m - links";
$title_list["chat"]="Y o u r s i t e . c o m - chatroom";
$title_list["tutorial"]="Y o u r s i t e . c o m - tutorials";
$title_list["contact"]="Y o u r s i t e . c o m - contact";
$title_list["staff"]="Y o u r s i t e . c o m - staff";

if (!$sectionName){
$sectionName="home";
}

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><? echo $title_list[$sectionName]; ?></title>
<? include("./addins/meta.inc"); ?>
<? include("./addins/script.inc"); ?>
<? include("./addins/style.inc"); ?>
</head>
<body background="img/gray.gif" onLoad="preLoad(<? for ($i=0;$i<sizeof($menu_list)-1;$i++){ echo "'".$menu_list[$i]."',"; }; echo "'".$menu_list[sizeof($menu_list)-1]."'"; ?>)" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0"
><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0"
><tr
><td valign="top"
><table width="760" border="0" cellspacing="0" cellpadding="0"
><tr
><td background="img/wave.gif" width="112" height="455" valign="top"> </td
><td bgcolor="#cccccc" width="102" height="455" valign="top"
><img src="img/nav/nav_top.gif" width="102" height="75" vspace="0" hspace="0"
><img src="img/nav/resource.gif" width="102" height="23" vspace="0" hspace="0"
<? include("./addins/mainmenu.inc"); ?>
><img src="img/nav/nav_bot.gif" width="102" height="55" vspace="0" hspace="0"
></td
><td bgcolor="#cccccc" width="19" height="455" valign="top"><img src="img/tallcol.gif" width="19" height="455" vspace="0" hspace="0"></td
><td bgcolor="#cccccc" background="img/mainbg.gif" width="405" height="455" valign="top"
><img src="img/magic.gif" width="405" height="98" vspace="0" hspace="0" border="0"
><table width="405" border="0" cellspacing="0" cellpadding="0"
><tr
><td background="img/top_tab.gif" valign="middle" width="405" height="26"><font color="#ffffff" size="1" face="verdana,arial,helvetica"> <? echo $date; ?><img src="img/magic.gif" height="1" width="40">Your IP: <? echo $ip; ?></font></td
></tr
><tr
><td valign="top" width="405" height="284"
><table width="405" height="284" border="0" cellspacing="0" cellpadding="0"
><tr
><td valign="top" width="405" height="10"><img src="img/sect1.gif" width="405" height="10" vspace="0" hspace="0"></td
></tr
><tr
><td background="img/sect2.gif" valign="top" width="405" height="264">
<table width="405" border="0" cellspacing="0" cellpadding="5">
<tr>
<td valign="top" width="405">
<? include"(./incs/$sectionName.inc"); ?>
</td>
</tr>
</table>
</td
></tr
><tr
><td valign="top" width="405" height="10"><img src="img/sect3.gif" width="405" height="10" vspace="0" hspace="0"></td
></tr
></table
><br></td
></tr
></table
></td
><td bgcolor="#cccccc" width="22" height="455" valign="top"><img src="img/rstrip.gif" width="22" height="455" vspace="0" hspace="0"></td
><td background="img/gray.gif" width="100" height="455" valign="top"> </td
></tr
></table
></td
></tr
></table
></body>
</html>



--------------------------------------------------------------------------------
[mainmenu.inc]
--------------------------------------------------------------------------------

<?
for ($i=0;$i<sizeof($menu_list);$i++){

if ($sectionName==$menu_list[$i]){
?>
><img src="img/nav/<? echo $menu_list[$i]; ?>_on.gif" vspace="0" hspace="0" name="<? echo $menu_list[$i]; ?>" border="0"
<?
}else{
?>
><a href="index.php?sectionName=<? echo $menu_list[$i]; ?>" onMouseover="swap('<? echo $menu_list[$i]; ?>')" onMouseOut="restore('<? echo $menu_list[$i]; ?>')"
><img src="img/nav/<? echo $menu_list[$i]; ?>_off.gif" vspace="0" hspace="0" name="<? echo $menu_list[$i]; ?>" border="0" alt="<? echo $menu_list[$i]; ?>"
></a
<?
}
}
?>


--------------------------------------------------------------------------------
[style.inc]
--------------------------------------------------------------------------------
* - File containing CSS stles + stuuff


--------------------------------------------------------------------------------
[meta.inc]
--------------------------------------------------------------------------------
* - File containing Meta Information


--------------------------------------------------------------------------------
[script.inc]
--------------------------------------------------------------------------------

* - File containg JavaScript(s)
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions