dynamically populate drop-down list and dynamically include html file



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?

.



Relevant Pages

  • Re: dynamically populate drop-down list and dynamically include html file
    ... and in turn we want to include a HTML file ... line with the product name, "Laptop", then add a new text file named ... By far the easiest and slickest way to accomplish this is with AJAX. ... having to click anything and without having to refresh the screen. ...
    (comp.lang.php)
  • Re: Writing data to HTML file BEFORE the tag.
    ... which then appends the user comments to the ... end of the HTML file on which the form is located. ... This PHP code ... The exit call here will prevent the script from returning a complete ...
    (comp.lang.php)
  • Re: HTML/PHP include files
    ... not sure if this is the problem but your two php files are different: ... see if its the problem by copying your includes dir to the jennifer dir and ... or use the absolute paths above(make sure to delete jennifer/includes so you ... I thought that I could include an html file from a php statement ...
    (alt.html)
  • Re: Can PHP be used to write permanent file changes?
    ... perl, php, cgi or something else so I was wondering what you would ... write the new html file on the server? ... Something to process user submissions and store them ... PHP has no problem writing an HTML file ...
    (php.general)
  • Re: Change included code
    ... Index.php is basically an html file uses a linked css file and when its included in the new file its referencing a css file in the wrong spot. ... It would actually be a bit more trouble since any time I want to upload to the server to test I will have to change the link. ... Would be easier just to have php just add "../" to one spot instead manually doing it every time I upload to the server. ...
    (comp.lang.php)