Solved

Help Creating a Dynamic Drop Down menu using PHP and Dreamweaver

Posted on 2007-11-15
6
1,679 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
  • 3
  • 3
6 Comments
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
.....can not quite understand this
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 70

Expert Comment

by:Jason C. Levine
Comment Utility
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
Comment Utility
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
Comment Utility
>> 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

762 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now