Forums

This topic is locked

Dynamic jump menus with php?

Posted 30 Nov 2007 20:31:22
1
has voted
30 Nov 2007 20:31:22 Emma Leighton posted:
<pre id=code><font face=courier size=2 id=code>
DWMX | PHP | MQSQL

I would like to use the DW jumpmenu to get records from a MYSQL database and then move to another page to display the results.

I have a two recordsets; one (diary_rs) contains information about talks taking place and the second (topic_rs) a list of topics.

So far I have been able to get the jump menu to connect to the database to display the list of topics but I can't get it display a new page (topic_page.php) with all talks on that topic once selected. I think it's a problem with the a href&gt; command - I can't seem to integrate it with the rest of the code

The jump menu code is;


&lt;form action="" method="post" name="form3" id="form3"&gt;
&lt;select name="menu2" onchange="MM_jumpMenu('parent',this,0)"&gt;
&lt;option value="#"&gt;select a topic&lt;/option&gt;
&lt;?php
do {
$topic_id = $row_topic_rs['topic_id'];
?&gt;
&lt;option value="&lt;a href=topic_page.php?topic_id=&lt;?php echo $topic_id;?&gt;"&gt;&lt;?php echo $row_topic_rs['topic']?&gt;&lt;/option&gt;
&lt;?php
} while ($row_topic_rs = mysql_fetch_assoc($topic_rs));
$rows = mysql_num_rows($topic_rs);
if($rows &gt; 0) {
mysql_data_seek($topic_rs, 0);
$row_topic_rs = mysql_fetch_assoc($topic_rs);
}
?&gt;
&lt;/select&gt;
&lt;/form&gt;


I've got this to work without the jumpmenu i.e. display a list of topic links and then display results on a new page so I think that it is a problem with how I am integrating the &lt;a href&gt; with the option value. I'm not sure if it is even possible to do this with php - I've seen some similar posts on this but they use asp.

V. stuck now - so any thoughts or suggestions would be really appreciated!

</font id=code></pre id=code>

Replies

Replied 02 Dec 2007 21:04:41
02 Dec 2007 21:04:41 Emma Leighton replied:
sorry, problem fixed (being stupid).

Reply to this topic