Solved

help in navigation bar

Posted on 2009-04-04
5
282 Views
Last Modified: 2012-08-13
i have a navigation bar in my php site that works like the one above in the expertexchange
but the issue is
when i press any link in this navigation (if ichoose for example from the above navigation "network" in the right side) it reset to the initial links (go back the left side)
it does not stay in this link
i have att ached the code for the nav bar
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256" />
<meta http-equiv="Content-Language" content="ar-sa" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta name="author" content="Engr. Khalid AlDossary" />
<meta name="description" content="Arabic Internet Auction - -1', 'D%F*1F* 'D91(J" />
 
<meta name="keywords" content="mstaml, mstamal, mustamal, mostamal, mustaml, mostaml, haraj, hraj, internet, arabic, arab, alarb,  saudi, arabia, classified, ads, money, sell, buy, use, free, offer, cheap, service, computer, pc, electronic, software, hardware, vehicles, rentals, car, trucks, villas, apartment, building, moving, storage, services, phone, number, phone, parts, monitor, disk, dvd, tv, ac, mobile, play station, book, engine, gold, watch, clock, other, industry, luxury, furniture, ad, agar, aqar, agarat, aqarat, electric,'DE3*9ED, -1',, 91(J, %F*1F*, (J9, 41'!, 916, 7D(, %J,'1, *B(JD, 9B'1, 3J'1), %DC*1HFJ'*, ,H'D, #1B'E, F3'&J'*, *9DJE, CE(JH*1, #+'+, /JCH1, E1C('*, E9/'*, %9D'F, E(H(" >
 
 
<style type="text/css">
html, body { margin-top: 1px; padding: 0; background-image: url(http://attejara.com/ms/template/style1/images/mybg.gif); text-align: center; }
p, a, div, span, h2, ul, ol, blockquote, input, select, textarea, td { font-size: 12px; font-family: Tahoma, "Times New Roman", serif; }
p, div { margin: 0; padding: 0; }
blockquote, ul, ol { margin-top: 0; margin-bottom: 0; }
p {				text-align: inherit; }
a { 				color: blue; text-decoration: none; }
a:hover {		color: red; text-decoration: none; }
h1 {				margin-top: 10px; margin-bottom: 5px; text-align: center; font-size: 12px; font-family: "Traditional Arabic", "Times New Roman", serif; }
h2 {				margin-top: 10px; margin-bottom: 2px; font-size: 12px; }
h3 {	font-size: 12px; }
h4 {	 font-size: 14px; }
h5 {	 font-size: 16px; }
.tit {				font-size: 12px; font-weight: bold; font-family: "Traditional Arabic", "Times New Roman", serif; }
.wng {			color: red; font-weight: bold; }
.don {			color: green; font-weight: bold; }
.wit {			color: white; font-weight: bold; }
.s2 {				font-size: 11px; }
.s1 {				font-size: 12px; }
.b1 {				font-size: 12px; }
.b2 {				font-size: 12px; }
form {			margin: 0; }
div.boxH {	border-left:1px solid #9BB8D3; border-right:1px solid #9BB8D3; border-top:1px solid #9BB8D3; border-bottom:0px solid #9BB8D3; background-color: #FFFFFF; text-align: center; font-weight: bold; padding: 2px; color: #000099 }
div.boxH3 {	border-left:1px solid #C7DBEB; border-right:1px solid #C7DBEB; border-top:1px solid #C7DBEB; border-bottom:0px solid #C7DBEB; background-color: #A7C6F4; text-align: right; font-weight: bold; padding: 2px; color: #000000 }
div.boxB {	border: 1px solid #9BB8D3; background-color: #F7F7F7; text-align: justify; padding: 2px; }
div.boxB3 {	border: 1px solid #C7DBEB; background-color: #F7F7F7; text-align: justify; padding: 2px; }
div.row {		clear: both; width: 100%; padding: 1px 0 1px 0; text-align: center; }
span.label {	float: right; width: 49%; text-align: left; }
span.field {	float: left; width: 49%; text-align: right; }
div.page {		direction: rtl; width: 750px; height: auto; border: 1px solid #7093B4; border-top-width: 0px; border-bottom-width: 8px; margin-left: auto; margin-right: auto; }
div.header {	width: 750px; height: 80px; background-color: #9BB8D3; }
div.menu {	width: 750px; background-color: #9BB8D3; }
div.body {	width: 750px; background-color:#000099; vertical-align: top; }
div.footer {	width: 750px; margin-left: auto; margin-right: auto; direction: rtl; }
div.buttonBrd1 {		float: right; width: 1px; height: 22px; background-color: #7093B4; }
div.buttonBrd2 {		float: right; width: 1px; height: 22px; background-color: #C7DBEB; }
#vbuttonBtm11, #vbuttonBtm12, #vbuttonBtm13, #vbuttonBtm14, #vbuttonBtm15, #vbuttonBtm16 {	float: right; width: 125px; height: 1px; background-color: #7093B4; }
#vbuttonBtm21, #vbuttonBtm22, #vbuttonBtm23, #vbuttonBtm24, #vbuttonBtm25, #vbuttonBtm26 {	float: right; width: 125px; height: 1px; background-color: #C7DBEB; }
div.button {		float: right; width: 123px; height: 22px;background-image: url(http://attejara.com/ms/template/style1/images/butbg.gif); }
div.button a {	display: block; height: 100%; width: 100%; font-size: 12px; color: white; text-decoration: none; text-align:center; padding-top: 3px; }
div.button a:hover {	color: #08224A; text-decoration: none; padding-top: 3px; }
div.links {					clear: both; width: 750px; height: 23px; background-color: #9BB8D3; }
div.links a {				font-size: 12px; color: #2E5376; text-decoration: none; }
div.links a:hover {		color: #08224A; text-decoration: none; }
div.links p {				font-size: 11px; color: #A7C6F4; margin: 0; padding: 4px 0 0 0; text-align: center; display: none; }
		#vButton1 { background-color: #9BB8D3; }
		#vbuttonBtm11 { background-color: #9BB8D3; }
		#vbuttonBtm21 { background-color: #9BB8D3; }
		#vLinks1 { display: block; }</style>
</head>
<body>
 
	<div class="menu"><script type="text/javascript">
	function funBlink(i, vObj){
		if(i % 2){ document.getElementById("vLinks" + vObj).style.backgroundColor = "#ABC3D9"; }
		else{ document.getElementById("vLinks" + vObj).style.backgroundColor = "#C7DBEB"; }
		if(i < 4){ setTimeout("funBlink(" + (i + 1) + ", " + vObj + ")", 75); }
		else{ document.getElementById("vLinks" + vObj).style.backgroundColor = "#9BB8D3"; }
	}
	function funMenu(vObj){
		for(i = 1; i <= 6; i++){
			document.getElementById("vButton" + i).style.backgroundColor = "#9BB8D3";
			document.getElementById("vButtonBtm1" + i).style.backgroundColor = "#7093B4";
			document.getElementById("vButtonBtm2" + i).style.backgroundColor = "#C7DBEB";
			document.getElementById("vLinks" + i).style.display = "none";
		}
		document.getElementById("vButtonBtm1" + vObj).style.backgroundColor = "#9BB8D3";
		document.getElementById("vButtonBtm2" + vObj).style.backgroundColor = "#9BB8D3";
		document.getElementById("vLinks" + vObj).style.display = "block";
		document.getElementById("vButton" + vObj).style.backgroundColor = "#9BB8D3";
		document.getElementById("vLinks" + vObj).style.height = "23px"; // important for funBlink
		funBlink(1, vObj);
	}
 
      </script>
<div style="clear: both; border-bottom: 1px solid #7093B4; width: 750px; height: 0;"><!-- --></div><div style="clear: both; border-bottom: 1px solid #C7DBEB; width: 750px; height: 0;"><!-- --></div>
<div id="vButton1" class="button" ><a href="javascript:funMenu('1')"><span lang="ar-eg">
	<font color="#2E5376">'D1&J3J)</font></span></a></div>
<div class="buttonBrd2"><font color="#2E5376"><!-- --></font></div><div class="buttonBrd1">
		<font color="#2E5376"><!-- --></font></div>
<div id="vButton2" class="button"><a href="javascript:funMenu('2')"><span lang="ar-eg">
	<font color="#2E5376">'D3HB</font></span></a></div>
<div class="buttonBrd2"><font color="#2E5376"><!-- --></font></div><div class="buttonBrd1">
		<font color="#2E5376"><!-- --></font></div>
<div id="vButton3" class="button"><a href="javascript:funMenu('3')"><span lang="ar-eg">
	<font color="#2E5376">'DEF*/I</font></span></a></div>
<div class="buttonBrd2"><font color="#2E5376"><!-- --></font></div><div class="buttonBrd1">
		<font color="#2E5376"><!-- --></font></div>
<div id="vButton4" class="button"><a href="javascript:funMenu('4')"><span lang="ar-eg">
	<font color="#2E5376">%/'1*C</font></span></a></div>
 
<div class="buttonBrd2"><font color="#2E5376"><!-- --></font></div><div class="buttonBrd1">
		<font color="#2E5376"><!-- --></font></div>
<div id="vButton5" class="button"><span lang="ar-eg"><a href="javascript:funMenu('5')">
  	<font color="#2E5376">'D./E'* 'DE/AH9)</font></a></span></div>
 
 
<div class="buttonBrd2"><font color="#2E5376"><!-- --></font></div><div class="buttonBrd1">
		<font color="#2E5376"><!-- --></font></div>
<div id="vButton6" class="button" ><a href="javascript:funMenu('6')"><span lang="ar-eg"> 
	<font color="#2E5376">-HD 'DEHB9</font></span></a></div>
 
 
<div style="clear: both;">	<div id="vButtonBtm11"><font color="#FFFFFF"><!-- -->
	</font></div><div id="vButtonBtm12"><font color="#FFFFFF"><!-- --></font></div><div id="vButtonBtm13">
	<font color="#FFFFFF"><!-- --></font></div>
	<div id="vButtonBtm14"><font color="#FFFFFF"><!-- --></font></div><div id="vButtonBtm15">
	<font color="#FFFFFF"><!-- --></font></div><div id="vButtonBtm16">
		<font color="#FFFFFF"><!-- --></font></div>
</div>
<div style="clear: both;">	<div id="vButtonBtm21"><font color="#FFFFFF"><!-- -->
	</font></div><div id="vButtonBtm22"><font color="#FFFFFF"><!-- --></font></div><div id="vButtonBtm23">
	<font color="#FFFFFF"><!-- --></font></div>
	<div id="vButtonBtm24"><font color="#FFFFFF"><!-- --></font></div><div id="vButtonBtm25">
	<font color="#FFFFFF"><!-- --></font></div><div id="vButtonBtm26">
		<font color="#FFFFFF"><!-- --></font></div>
 
</div>
 
<div class="links"><p id="vLinks1"><span lang="ar-eg"><font color="#BCDBDB">|</font><a href="index.php">
	&nbsp;'D5A-) 'D1&J3J)	
	<font color="#BCDBDB">|</font>
	<a href="index.php?action=mtjers">
	&nbsp;'DE*',1 'D'DC*1HFJ)</a><font color="#FFFFFF"> 
	</font><font color="#BCDBDB"> |</font><font color="#FFFFFF">&nbsp;
</p>
	</font><font color="#000080"> 
<p id="vLinks2"><font color="#BCDBDB">|</font>
<a href="index.php?action=advanced_search">3HB 'D*,'1) 'D9'DEJ</a>
<font color="#BCDBDB"> |</font>
 
	<a href="index.php?action=advanced_search">(-+ E*B/E</a>
<font color="#BCDBDB"> |</font>
 
 
<a href="index.php?action=advanced_search">
'D%9D'F'* 'DEA6D)</a><font color="#FFFFFF"> 
	
	</font>
 
	<font color="#BCDBDB"> |</font><font color="#FFFFFF">&nbsp;
	
	</font>
 
	<a href="index.php?action=add_s">%6'A) %9D'F</a><font color="#FFFFFF"> 
 
	</font>
 
<font color="#BCDBDB"> |</font><font color="#FFFFFF"> 
 
	</font>
 
</p>
<p id="vLinks3"><font color="#BCDBDB">|</font><font color="#FFFFFF">&nbsp; 
 
</font>
<a href="index.php?action=all_fs">
EF*/I 'D*,'1) </a><font color="#BCDBDB">|</font>
<a href="index.php?action=preferred_fs">
'DEH'6J9 'DEA6D) </a></font></span>  
<font color="#BCDBDB">|</font><font color="#FFFFFF"><font color="#000080"> 
</font>
 
</font>
<font color="#000080"> 
<a href="index.php?action=add_fs">
'6'A) EH6H9 </a></font> <font color="#BCDBDB"> 
</span> |</font><font color="#000080"><font color="#FFFFFF">
 
</font>
</p>
<p id="vLinks4">|
	<a href="index.php?action=counts">%-5'&J'*</a> |
	<a href="index.php?action=inside_mail">'D(1J/ 'D/'.DJ</a> | 
	<a href="index.php?action=your_mtjer">*5EJE E*,1C</a> | 
		<a href="index.php?action=u_forums&mem_id=<? echo $memberid; ?>">EF*/'C 'D%DC*1HFJ</a> |
	<a href="index.php?action=adv_adv&mid=<? echo $memberid; ?>">%9D'F'*C</a> |
	<a href="index.php?action=u_replay">1/H/C</a> |
<?
			$selectforum= mysql_query ("SELECT * from forums where mem_id='$memberid' and active='1'");
			$countforum= mysql_num_rows($selectforum);
			
if ($countforum == "0"){
echo "<a href=index.php?action=u_forum>*5EJE EF*/'C</a> |";}
if ($countmtjer > "0"){ }
?>
 
	<a href="index.php?action=u_fs&mem_id=<? echo $memberid; ?>">EH'6J9C</a> |
	<a href="index.php?action=u_fs_replay">1/H/C</a> |
<!--	<a href="/manage/customize.php">*.5J5 'DEHB9</a> | -->
	<a href="index.php?action=update_yours">*-/J+ E9DHE'*C</a> |
</p>
 
<p id="vLinks5">|
	<a href="index.php?action=special_member">'D96HJ) 'D0G(J)</a> |
	<a href="index.php?action=special_member_silver">'D96HJ) 'DA6J)</a> |
	<a href="index.php?action=determine_advs">'D%9D'F'* 'DE+(*)</a> |
	<a href="index.php?action=commercial_advs">'D%9D'F'* 'D*,'1J)</a> |
	<a href="index.php?action=reaia">'D19'J) 'D13EJ)</a> |
	<a href="index.php?action=commission">9EHD) 'DEHB9</a> |
</p>
 <p id="vLinks6"><font color="#BCDBDB">|</font><font color="#FFFFFF">
	</font>
	<a href="index.php?action=pages&page=1"><span lang="ar-eg">
	E'GH 3HB 'D*,'1)</span></a><font color="#FFFFFF"> 
	</font>
	<font color="#BCDBDB"> 
	|</font><font color="#FFFFFF"> 
	</font>
	<a href="index.php?action=repeat_questions"><span lang="ar-eg">
	'D#3&D) 'DEC11)</span></a><font color="#FFFFFF"> 
	</font>
	<font color="#BCDBDB"> 
	|
	</font>
	<a href="index.php?action=call_us"><span lang="ar-eg">'*5D (F'</span></a><font color="#FFFFFF"> 
	</font>
	<font color="#BCDBDB"> |</font><font color="#FFFFFF"> 
	</font>
	<a href="index.php?action=pages&page=2"><span lang="ar-eg">
	1H'(7 3HB 'D*,'1)</span></a><font color="#FFFFFF"> 
	</font>
	<font color="#BCDBDB"> 
	|</font><font color="#FFFFFF"> 
	<!--	<a href="index.php?action=pages&page=3">E3*9ED AJ 'D%9D'E</a> | -->
	</font>
	<a href="index.php?action=pages&page=4"><span lang="ar-eg">
	'*A'BJ) '3*./'E 'DEHB9</span></a><font color="#BCDBDB"> 
	|</font><font color="#FFFFFF"> 
	</font>
</p> 
</div></div>
 
	<p></p>
 
</body>
</html>

Open in new window

0
Comment
Question by:dr_lionheart
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:Pantalaim0n
ID: 24070697
You need to pass the current navbar tab in either a session, cookie or GET variable and use them when you process the navbar in PHP.
0
 
LVL 3

Author Comment

by:dr_lionheart
ID: 24070703
can you give an example or a  code to start with
0
 
LVL 5

Accepted Solution

by:
Pantalaim0n earned 500 total points
ID: 24070797
Here's a quick example. There's alot of room for optimalisation here, but it gives you an idea.
I chose for the easy GET solution

<?php
	$tab = isset($_GET['tab'])?$_GET['tab']:1;
?>
<html>
	<head>
		<script type="text/javascript">
			function openTab(idx) {
				var subnav = document.getElementById("subnav");
				for (i=0;i<subnav.childNodes.length; i++) if ((subnav.childNodes[i].tagName)&&(subnav.childNodes[i].tagName.toLowerCase()=='div')) subnav.childNodes[i].style.display="none";
				document.getElementById("tab"+idx).style.display="block";
			}
		</script>
		<style>
			#tabs, #subnav {
				border:1px blue solid; height:30px;
			}
			#tabs .tab, #subnav .link {
				float:left;
				padding:0 15px 0 15px;
			}
		</style>
	<body>
		<div id="tabs">
			<div class="tab"><a href="#" onclick="openTab(1);">Tab 1</a></div>
			<div class="tab"><a href="#" onclick="openTab(2);">Tab 2</a></div>
			<div class="tab"><a href="#" onclick="openTab(3);">Tab 3</a></div>
			<div class="tab"><a href="#" onclick="openTab(4);">Tab 4</a></div>
			<div class="tab"><a href="#" onclick="openTab(5);">Tab 5</a></div>
		</div>
		<div id="subnav">
			<div id="tab1" style="display:none;">
				<div class="link"><a href="index.php?tab=1">Link A1</a></div>
				<div class="link"><a href="index.php?tab=1">Link A2</a></div>
				<div class="link"><a href="index.php?tab=1">Link A3</a></div>
				<div class="link"><a href="index.php?tab=1">Link A4</a></div>
			</div>
			<div id="tab2" style="display:none;">
				<div class="link"><a href="index.php?tab=2">Link B1</a></div>
				<div class="link"><a href="index.php?tab=2">Link B2</a></div>
				<div class="link"><a href="index.php?tab=2">Link B3</a></div>
				<div class="link"><a href="index.php?tab=2">Link B4</a></div>
			</div>
			<div id="tab3" style="display:none;">
				<div class="link"><a href="index.php?tab=3">Link C1</a></div>
				<div class="link"><a href="index.php?tab=3">Link C2</a></div>
				<div class="link"><a href="index.php?tab=3">Link C3</a></div>
				<div class="link"><a href="index.php?tab=3">Link C4</a></div>
			</div>
			<div id="tab4" style="display:none;">
				<div class="link"><a href="index.php?tab=4">Link D1</a></div>
				<div class="link"><a href="index.php?tab=4">Link D2</a></div>
				<div class="link"><a href="index.php?tab=4">Link D3</a></div>
				<div class="link"><a href="index.php?tab=4">Link D4</a></div>
			</div>
			<div id="tab5" style="display:none;">
				<div class="link"><a href="index.php?tab=5">Link E1</a></div>
				<div class="link"><a href="index.php?tab=5">Link E2</a></div>
				<div class="link"><a href="index.php?tab=5">Link E3</a></div>
				<div class="link"><a href="index.php?tab=5">Link E4</a></div>
			</div>
		</div>
		<script type="text/javascript">openTab(<?php echo $tab; ?>);</script>
	</body>
</html>

Open in new window

0
 
LVL 3

Author Closing Comment

by:dr_lionheart
ID: 31566665
accurate and perfect
thanks alot
0
 
LVL 3

Author Comment

by:dr_lionheart
ID: 24071161
i did it in this link
check
http://www.attejara.com
thankssss
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question