help in navigation bar

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="">
<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(; 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; } {		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; } {	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(; }
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>
	<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);
<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 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 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;
	</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 color="#BCDBDB"> |</font><font color="#FFFFFF">&nbsp;
	<a href="index.php?action=add_s">%6'A) %9D'F</a><font color="#FFFFFF"> 
<font color="#BCDBDB"> |</font><font color="#FFFFFF"> 
<p id="vLinks3"><font color="#BCDBDB">|</font><font color="#FFFFFF">&nbsp; 
<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 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">
<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 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 id="vLinks6"><font color="#BCDBDB">|</font><font color="#FFFFFF">
	<a href="index.php?action=pages&page=1"><span lang="ar-eg">
	E'GH 3HB 'D*,'1)</span></a><font color="#FFFFFF"> 
	<font color="#BCDBDB"> 
	|</font><font color="#FFFFFF"> 
	<a href="index.php?action=repeat_questions"><span lang="ar-eg">
	'D#3&D) 'DEC11)</span></a><font color="#FFFFFF"> 
	<font color="#BCDBDB"> 
	<a href="index.php?action=call_us"><span lang="ar-eg">'*5D (F'</span></a><font color="#FFFFFF"> 
	<font color="#BCDBDB"> |</font><font color="#FFFFFF"> 
	<a href="index.php?action=pages&page=2"><span lang="ar-eg">
	1H'(7 3HB 'D*,'1)</span></a><font color="#FFFFFF"> 
	<font color="#BCDBDB"> 
	|</font><font color="#FFFFFF"> 
	<!--	<a href="index.php?action=pages&page=3">E3*9ED AJ 'D%9D'E</a> | -->
	<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"> 

Open in new window

Who is Participating?
Pantalaim0nConnect With a Mentor Commented:
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

	$tab = isset($_GET['tab'])?$_GET['tab']:1;
		<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";
			#tabs, #subnav {
				border:1px blue solid; height:30px;
			#tabs .tab, #subnav .link {
				padding:0 15px 0 15px;
		<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 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 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 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 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 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>
		<script type="text/javascript">openTab(<?php echo $tab; ?>);</script>

Open in new window

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.
dr_lionheartAuthor Commented:
can you give an example or a  code to start with
dr_lionheartAuthor Commented:
accurate and perfect
thanks alot
dr_lionheartAuthor Commented:
i did it in this link
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.