Jump to content


Photo

LINKING A CASCADING MENU ITEM TO A PHP FILE..

html php mysql

  • Please log in to reply
1 reply to this topic

#1 visitnag

visitnag

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 10 February 2013 - 10:11 PM

Hi all,

I have created a cascading menu like following.

<ul id="nav" style="float:left; clear:both;" name="br">
<li><a href="#"><b>City List</b></a>
<ul>
<li value="398A" ><a href="main.php">BEEJING</a></li>
<li value="125B" ><a href="#">NEWYORK </a></li>
<li value="734C" ><a href="#">ADELLAIDE </a></li>
<li value="859D"><a href="#">MELBOURNE </a></li>
</ul>
</li>

My problem is when I click on the city list it wil open main.php according to the city value code. But the above code is opening a blank main.php file with headers. How to change the above to accept the city code to open main.php

The main.php few lines..


html>
<body>
<body bgcolor="#D8AF92">
<?php
$citycode=$_REQUEST['citycode'];
include("dbconnect.php");
----
----
----


Thank you.

#2 denno020

denno020

    Advanced Member

  • Members
  • PipPipPip
  • 712 posts
  • LocationAustralia

Posted 16 February 2013 - 07:45 PM

<ul id="nav" style="float:left; clear:both;" name="br">
<li><a href="#"><b>City List</b></a>
<ul>
<li><a href="main.php?value=398A">BEEJING</a></li>
<li value="125B" ><a href="#">NEWYORK	</a></li>
<li value="734C" ><a href="#">ADELLAIDE </a></li>
<li value="859D"><a href="#">MELBOURNE </a></li>
</ul>
</li>

Then you retrieve the value in main.php using the $_GET variable array as such:

$value = $_GET['value'];

Denno

Edited by denno020, 16 February 2013 - 07:47 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com