[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Help Creating a Dynamic Drop Down menu using PHP and Dreamweaver

Posted on 2007-11-15
6
Medium Priority
?
1,688 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
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 Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

649 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