3 Replies - 3185 Views - Last Post: 02 March 2008 - 07:20 PM Rate Topic: -----

#1 -Monkey-   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-March 08

How to populate web form select list from .LST file?

Post icon  Posted 02 March 2008 - 01:39 PM


I have some websites with database search forms which pass the form user inputs to a CGI script, which in turn queries an MS Access database on the server (W2K, IIS 5), based on the corresponding database fields the user has searched on. The search rsults are then returned to the user.

The back end database is a photographic image library, which administrators update using the database PC client app. The websites hook into this database, to publish the content to web users.

I have absolutely no control of either the Access database or the CGI script code. I can therefore only edit the HTML for the website.

The question is: Can I populate the web form SELECT lists dynamically from an .LST file that resides on the web server, rather than hard code the list options in the HTML SELECT options?

For example, there is a field called LOCATION in the Access database. On the back end, the Access ListBox values (countries) for the database admin's field dropdown list are stored in a file called LIST1.LST (not sure whether .LST file is native to Access, or whether it's related to VB code that's used in the CGI search engine script - anyway, I know that's where the list values for the database's forms are stored!).

Currently, I have to frequently look at the back end database (using the library administrator's client app) to see what countries are defined in the field list, then manualyy update the website SELECT list options to match. Users can frequently add/remove a list item in the backend database, so this can be a real pain, to users and myself!

I know virtually nothing about PHP (though already using a PHP script to force a Save As dialog when linking to jpeg files, so not completely new). Unfortunately I don't have time to crash learn it right now, so would appreciate if someone could please give me a Lego-like solution here!

So, currently my website HTML code for the form input of the LOCATION field is something like:

<SELECT NAME="LOCATION" style="width:217">
<OPTION VALUE="Austria">Austria
<OPTION VALUE="Denmark">Denmark
<OPTION VALUE="Germany">Germany


Instead of using hard-coded OPTION values for the dropdown list like this, I want to pull them straight in from the LIST_1.LST file that lives in the database folder on the server.

I opened the LST file in Notepad and can see the country names followed by white space. Each country appears to take up 80 bytes in the file, even though the LOCATION field is only 64 characters long in the Access database, so I guess there are some kind of invisible delimiter characters in there, or hex codes used by Access, not sure. The country names themselves appear fine.

I'd be over the moon if anyone can help thanks. I've spent ages looking already. Ideally, a block of code I can just paste straight into the HTML. Already running PHP 5.


Is This A Good Question/Topic? 0
  • +

Replies To: How to populate web form select list from .LST file?

#2 PsychoCoder   User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1663
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: How to populate web form select list from .LST file?

Posted 02 March 2008 - 01:51 PM

Welcome to </dream.in.code> -Monkey-, glad you could make it! Hope to see you around the forums someday :)

For future reference you need to post your programming question in the proper forum so it gets the attention it needs. This forum is for introductions only?

Happy Coding!
Was This Post Helpful? 0
  • +
  • -

#3 Nykc   User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 740
  • View blog
  • Posts: 8,654
  • Joined: 14-September 07

Re: How to populate web form select list from .LST file?

Posted 02 March 2008 - 03:49 PM

Hello & Welcome to Dream In Code.
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil   User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6876
  • View blog
  • Posts: 31,671
  • Joined: 10-May 07

Re: How to populate web form select list from .LST file?

Posted 02 March 2008 - 07:20 PM

Duplicate post : http://www.dreaminco...wtopic44911.htm

** Topic Closed! **
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1