User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,705 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,191 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1127 | Replies: 0
Reply
Join Date: Dec 2005
Location: Malaysia...Truly Asia!
Posts: 4
Reputation: ibnuasad is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ibnuasad's Avatar
ibnuasad ibnuasad is offline Offline
Newbie Poster

Help Making a static but yet a dynamic navigation

  #1  
Sep 24th, 2006
I know it sounds confusing but I will try my best to explain what I really mean.

Here is part of my css code:
.navitab {
padding: 4px 8px 4px 8px;
margin: 0 0 4px 0;
text-decoration: none;
letter-spacing: 1px;
background: #e0e0e0 url(images/corner.gif) top right no-repeat;
border-bottom: 1px solid #ffffff;
border-left: 1px solid #ffffff;
}

.activenavitab {
padding: 4px 8px 5px 8px;
color: #ffffff;
margin: 0 0 5px 0;
text-decoration: none;
background: #505050 url(images/corner.gif) top right no-repeat;
}

And my navigation bar at http://ibnuasad.org
<div id="navitabs">
<h2 class="hide">Site menu:</h2>
<a class="activenavitab" href="index.html">Welcome</a><span class="hide"> | </span>
<a class="navitab" href="#">Bio</a><span class="hide"> | </span>
<a class="navitab" href="#">Discography</a><span class="hide"> | </span>
<a class="navitab" href="#">Downloads</a><span class="hide"> | </span>
<a class="navitab" href="#">Photos</a><span class="hide"> | </span>
<a class="navitab" href="#">Tour</a><span class="hide"> | </span>
<a class="navitab" href="#">Merchandise</a><span class="hide"> | </span>
<a class="navitab" href="#">Interviews</a>
</div>

The navigation code is located at index.html. I want to move the code to a separate file called navigation.php and I would place <?php include("navigation.php") ?> in my index.html file.

Here's the problem:
I want to make something like when I go to index.html I want the "Welcome" text to use the activenavitab style. But when I go to downloads.html I want the "Downloads" text to use the style activenavitab and make the "Welcome" text use the "navitab" style.

Note that I will also be using the code <?php include("navigation.php") ?> in the downloads.html file

Anyone knows how to this?

Btw, I was not sure where to post this thread cause it involves CSS, HTML and PHP

EDIT:
Someone had give me the code
[PHP]<?php
$l[0][0] = "index.html";
$l[0][1] = "Welcome";

$l[1][0] = "bio.html";
$l[1][1] = "Bio";

$l[2][0] = "contact-page.html";
$l[2][1] = "Contact Me";


$l[3][0] = "gallery.html";
$l[3][1] = "Gallery";


$thispage = $_SERVER['SCRIPT_NAME'];

$arr = explode("/", $thispage);
$page = strtolower($arr[2]);
?>
<?php
$i = 0;
while ($l[$i] != "") {
if (strtolower(str_replace(" ", "", $l[$i][0])) == $page) {
echo "<a class=\"activenavitab\" href=\"" . $l[$i][0] . "\">" . $l[$i][1] . "</a>"; }
else {
echo "<a class=\"navitab\" href=\"" . $l[$i][0] . "\">" . $l[$i][1] . "</a>"; }
$i++;
}

?> [/PHP]

But it still wont show the activenavitab style...I have placed the code into navigation.php and implement it on http://ibnuasad.org/bio.html

Can someone please help me I'm still a php newbie
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb PHP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 2:46 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC