Re: dynamically populate drop-down list and dynamically include html file



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?


I'd use a database. The vast majority of sites use MySQL for a database, but if you want it to be portable you can use the PEAR::MDB2 package. It's portable to many different databases.

You could do it with a flat file, but it will make your job a lot harder (and the data much more prone to errors).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • nside MySpace.com 1.
    ... never have to bear more than a small fraction of the traffic MySpace ... the Web site displays what he calls "the ... database, with MySpace users frequently seeing a Web page headlined ... database and storage systems to try to keep pace with exploding growth, ...
    (microsoft.public.windows.server.general)
  • And yet another one from the mind of Lohkee!
    ... Internet Content Blocking Software ... Some organizations that allow employees to surf the net have ... a database of websites that have been categorized by type of the content ... existence of a web site before you can categorize it. ...
    (comp.security.misc)
  • And yet another one from the mind of Lohkee!
    ... Internet Content Blocking Software ... Some organizations that allow employees to surf the net have ... a database of websites that have been categorized by type of the content ... existence of a web site before you can categorize it. ...
    (comp.os.ms-windows.nt.admin.security)
  • And yet another one from the mind of Lohkee!
    ... Internet Content Blocking Software ... Some organizations that allow employees to surf the net have ... a database of websites that have been categorized by type of the content ... existence of a web site before you can categorize it. ...
    (microsoft.public.win2000.security)
  • Re: And yet another one from the mind of Lohkee!
    ... already done the work of setting up the database. ... > Internet Content Blocking Software ... Some organizations that allow employees to surf the net ... > existence of a web site before you can categorize it. ...
    (comp.os.ms-windows.nt.admin.security)