?
Solved

Help Creating a Dynamic Drop Down menu using PHP and Dreamweaver

Posted on 2007-11-15
6
Medium Priority
?
1,687 Views
Last Modified: 2012-06-27
Hello
I need help building Dynamic Drop Down menu.

Here is the code for the menu:
==========
<form name="form1">
      <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
        <option value="">Please Choose One</option>
        <?php
do {  
?>
        <option value="<?php echo $row_rsPlaceAll['id_plc']?>"><?php echo $row_rsPlaceAll['placebg_plc']?></option>
        <?php
} while ($row_rsPlaceAll = mysql_fetch_assoc($rsPlaceAll));
  $rows = mysql_num_rows($rsPlaceAll);
  if($rows > 0) {
      mysql_data_seek($rsPlaceAll, 0);
        $row_rsPlaceAll = mysql_fetch_assoc($rsPlaceAll);
  }
?>
      </select>
    </form>
===================
The menu actually display all values from the recorset but values are not linkable.
I need them to go to detailed page something like:
places.php?place=<?php echo $row_rsPlaceAll['placebg_plc']; ?>
0
Comment
Question by:mianet
[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
  • 3
6 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 600 total points
ID: 20294467
Hi mianet,

What happens when you put:

places.php?place=<?php echo $row_rsPlaceAll['placebg_plc']; ?>

in the value of the select?
0
 

Author Comment

by:mianet
ID: 20294598
Hi jason1178,

I've tried this but nothing happens.
I suppose that I have to use java script - something similar to this solution: http://www.experts-exchange.com/Web_Development/Software/Macromedia_Dreamweaver/Q_21305272.html?sfQueryTermInfo=1+dynam+jump+menu+php

but I can now quite understand this
0
 

Author Comment

by:mianet
ID: 20294623
.....can not quite understand this
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 20296131
You don't need to use javascript, but you should.  What part of the above link do you not understand?
0
 

Author Comment

by:mianet
ID: 20296367
Hi jason,
actually it is working now - I've put

places.php?place=<?php echo $row_rsPlaceAll['placebg_plc']; ?>

in the value of the select  and use this java script.

Could you please brief explain me why i should use the java script and how can i do it without this script

Thanks!
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 20296518
>> Could you please brief explain me why i should use the javascript and how can i do it without this script

It's easier to take these in reverse order.  You can use the get method for forms to set the query string.  So your form action would point to places.php and then change the name of the select to place.  Using the menu and submitting would result in this url:

places.php?place=(whatever value chosen)

The problem with this method and the reason to use javascript is that the GET method is inviting a PHP injection attack unless you take steps to ensure that values fed to your page through the query string are cleansed of malicious code.  To avoid this, stick with the javascript.



0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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