You are here: Re: dynamically populate drop-down list and dynamically include html file « PHP Programming Language « IT news, forums, messages
Re: dynamically populate drop-down list and dynamically include html file

Posted by bobmct on 09/02/06 01:42

Yi Chen wrote:

> We have a drop down list on a PHP page, with several product names, and
> when people click one item, we will refresh the same page with the
> product name as parameter, and in turn we want to include a HTML file
> into the content area of the same page.
>
> I know it is recommended to put everything into database, but we want
> the web site to be very "portable", so the drop-downlist and the
> content should both in text files.
>
> Let's say the drop-down list will be poplulated from the product.txt
> file, and there will be a file for each corresponding item in the
> drop-down list. From the user point of view, if he wants to add a new
> product, he will just need to open the product.txt file, and add a new
> line with the product name, "Laptop", then add a new text file named
> "laptop" in the same folder which contains the HTML fragment to be
> included in the content area.
>
> What is the easiest way to do this?

By far the easiest and slickest way to accomplish this is with AJAX. Search
the javascript group for ajax or better yet, search for mybic.php and
download and install. It is a function for using ajax and allows you to
access your host and receive content then dynamically populate virtually
anything (I like to populate drop down lists)... all without the user
having to click anything and without having to refresh the screen.

Good luck.

 

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

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