Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Php beginner - drop down menu tutorial

Featured Replies

You don't need php to make a drop down menu like the one in the link. Just create the menu as a <ul> and use CSS to create the drop downs.

 

If you need to see examples, take a look at cssplay.co.uk

  • Author

thanks notbanksy, I'm updating a site, so I'm working on third party code. The links are done like this:

 

<div id="TextMenu">
<a href="<?php echo $currentPage ?>?ID=5&type=Home">HOME</a>  |     
<a href="<?php echo $currentPage ?>?ID=33">ABOUT</a>  |  
<a href="<?php echo $currentPage ?>?ID=34">GETTING STARTED</a>  |  
<a href="<?php echo $currentPage ?>?ID=15">FACULTIES	</a>  |  
<a href="eLearning/index.php">CURRENT STUDENTS</a>  |  
<a href="<?php echo $currentPage ?>?ID=35">TESTIMONIALS</a>  |  
<a href="<?php echo $currentPage ?>?ID=35">BOOK ONLINE</a>  |  
<a href="<?php echo $currentPage ?>?ID=35">CONTACTS</a>  |  
<a href="<?php echo $currentPage ?>?ID=3">NEWS</a> </div>

 

so I dont want to strip out the php...This has to become a drop down menu..so I think it will have to be a php drop down menu?

You should be able to go the css route and retain the PHP bits.

 

By the way the link you are trying to emulate is flawed. It doesn't work in ie7, 8 or opera. The drop down menu is hidden behind the flash.

Hi,

 

Just enclose the <a> tags in <li> tags and place them all in an <ul>.

 

Then just assign classes to each top level <li> and lower level <li> tag and based on what page your on you can hide and display the others.

 

There are tons of tutorials on this. The link above will help. It's pretty easy, standard stuff really. You shouldn't have an issue.

  • Author

You should be able to go the css route and retain the PHP bits.

 

By the way the link you are trying to emulate is flawed. It doesn't work in ie7, 8 or opera. The drop down menu is hidden behind the flash.

 

 

I'm going to try the CSS way now so if it'll work ok with the php. cheers for the heads up on the menu on the other site, we'll get to fixing that now too :)

  • Author

Hi,

 

Just enclose the <a> tags in <li> tags and place them all in an <ul>.

 

Then just assign classes to each top level <li> and lower level <li> tag and based on what page your on you can hide and display the others.

 

There are tons of tutorials on this. The link above will help. It's pretty easy, standard stuff really. You shouldn't have an issue.

 

 

cheers Gareth, going to have a look at it now :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.