Jump to content

PHP with MySQL or JavaScript with a text file


rahulkadukar

Recommended Posts

This is my website http://www.rahulkadukar.info/

 

As you can see I have the blue navigation bar on top and on mouse hover you can see a drop down menu. The contents of the drop down menu can change and I wanted to write a script that would populate the contents of the drop down menus.

 

Which of these is a better option

1. Use JavaScript along with a text file and use JavaScript to populate the drop down

2. Use a SELECT in PHP to populate the drop down menu

 

I am expecting that the 10 main columns would have at the most 20 entries each.

The *best* solution would be using MySQL to store the navigation, and PHP to display it.

 

You can still get the dropdown effect without javascript by using CSS...do an unordered list, with a nested menu.  Then style li:hover to display the underlying menu items

Well I don't know why you would use javascript at all.

 

A mysql query for something as simple as a menu might slow you down 30ms...but if you are building the menu (and don't want to gow ith a database) you would be better of going with a text file with PHP than javascript.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.