You are here: Re: populate one menu from another « PHP Programming Language « IT news, forums, messages
Re: populate one menu from another

Posted by Gary L. Burnore on 11/17/92 11:52

On 10 Jul 2006 16:13:03 -0700, "flamer die.spam@hotmail.com"
<die.spam@hotmail.com> top posted like a moron and wrote:

>Mosf of the examples you have seen are probably using javascript, with
>php you realise the page needs to reload when a cat is chosen? PHP
>can't dynamically update the menu without loading the page again, you
>would the user to choose a catergory, then have a submit button to post
>the var or a link like page/index.php?cat1=$cat1 and so forth. Probably
>recommend javascript for this though.

The php code can generate the javascript code. Best of both "hello
worlds".

>
>Flamer.
>
>
>Chris wrote:
>
>> I thought this would be simple and there would be advice / tutorials
>> everywhere for this, but now that I'm working on it, I can't find any
>> reference except for ASP or Javascript code. PHP/MySQL - 3 form select
>> menus: Project, Categories, Subcategories. When a Project is selected, the
>> Categories list is populated based on Project selected, then Subcategories
>> list is populated based on Category selected. I see this all over the Net,
>> but through 10 books, there isn't anything specific. I think I get lost
>> with some of PHP structure since I've been using DW - I end up editing most
>> of it in order to follow it, but DW works pretty good for getting initial
>> testing done. I just can't seem to find further guidance on this. So far I
>> have:
>>
>> <form enctype="multipart/form-data" action="add_file.php" method="post">
>> <table>
>>
>> <tr>
>> <td width="23%" rowspan="2" valign="top"><p><strong>Project:<br />
>> </strong>
>> <select name="project">
>> <?php
>> do {
>> ?>
>> <option value="<?php echo
>> $row_projects['projCode']?>"><?php echo $row_projects['projCode']?></option>
>> <?php
>> } while ($row_projects = mysql_fetch_assoc($projects));
>> $rows = mysql_num_rows($projects);
>> if($rows > 0) {
>> mysql_data_seek($projects, 0);
>> $row_projects = mysql_fetch_assoc($projects);
>> }
>> ?>
>> </select>
>> </p>
>> <p><strong>
>> Category:
>> <select name="category" id="category">
>> <option>Select a category...</option>
>> <option value="<?php echo $row_categories['catName']?>"><?php
>> echo $row_categories['catName']?></option>
>> <?php
>> do {
>> ?>
>> <?php
>> } while ($row_categories = mysql_fetch_assoc($categories));
>> $rows = mysql_num_rows($categories);
>> if($rows > 0) {
>> mysql_data_seek($categories, 0);
>> $row_categories = mysql_fetch_assoc($categories);
>> }
>> ?>
>> </select>
>>
>> </strong></p>
>> <p>
>>
>> </p></td>
>> <td width="26%" valign="top"><p><strong>Subcategory:</strong>
>> <select name="subcategory" id="subcategory">
>> <option>Select a subcategory...</option>
>> <?php
>> if (isset('category'))
>> {
>> if ($row_subcat['catID']==$row_categories['catID'])
>> {
>> do
>> {?>
>> <option value="<?php echo $row_subcat['subcatName']; ?>"></option>
>> <?php
>> }
>> while ($row_subcat = mysql_fetch_assoc($subcat));
>> $rows = mysql_num_rows($subcat);
>> if($rows > 0)
>> {
>> mysql_data_seek($subcat, 0);
>> $row_subcat = mysql_fetch_assoc($subcat);
>> }
>> }
>> }
>> }
>> ?>
>> </select>
>>
>> Thanks for any help with this.
>>
>> Chris
--
gburnore at DataBasix dot Com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
Official .sig, Accept no substitutes. | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ 0 1 7 2 3 / Ý³Þ 3 7 4 9 3 0 Û³
Black Helicopter Repair Services, Ltd.| Official Proof of Purchase
===========================================================================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация