If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

It's certainly possible to do what you want, but you haven't given enough information about how the PDF file would be selected. Can you give us an example of the options you have in mind and how they affect the selection of the PDF?

Basically they would first select an industry. That would then give them the ability to select from a group of cameras and displays we build for that industry. Next they would choose the camera, display and controller they want to use form the available options. Once they have selected the three options they would get a PDF of that systems specs.

With that they could possibly choose from 3 display models, 6 camera models, and 3 controller models.

Does this offer enough information?

Thanks

A picture is worth a thousand words, but it uses up three thousand times the memory.

Well, yes and no. I was focusing on the number '3' from your initial post and didn't expect there to be quite so many possible choices involved. From your explanation here, there would be (at least?) 54 possible combinations. That's going to take a bit of effort.

What I should have explained is that some software will be required. You could certainly use something like a PHP script on the server to handle it, but I'd probably be inclined to embed some JavaScript in the page to do this unless there's some concern about keeping the location of the PDF files from being disclosed. Essentially, it requires a script that can match the selected options with a particular file. Your situation is a bit too complex to provide an off-the-cuff solution in my spare time here that you could easily adapt to your needs. Maybe someone else will chime in. Good luck!

it seems to me that the list of files could be greater than Rick estimates, because there are 54 combinations per industry, and an unspecified number of industries. Still, if once written the number of overall PDF files remains reasonably static, this could still be dealt with in an array without the added complexity of a database. However, the larger the array, the more I would opt for a server-side solution.

Also PHP offers an alternative to having to amend the code every time a new PDF file is added, or an old one deleted (or even just a change to the title!). That is of storing the options in a CSV file, and dynamically creating the array. Then maintenance of the list of PDF files would be segregated from the maintenance of the code. You also have the option to maintain a list per industry, if appropriate. Assuming a list per industry, the CSV file could be something like:

Note: One issue with CSV files is that spurious commas can blow the building of the array. That is why the text description (if included) is put at the end of the line. If it happens to contain commas, they merely truncate the description, and the remainder of the line is ignored.

there are pitfalls to using CSV, but there are work-arounds for those (using ";" as a delimiter, encapsulating strings with "", escaping delimiters in strings, etc.). XML is a often overlooked format for storing data. JavaScript can parse XML. You also have JSON format, JavaScript can parse this as well. Both are good transport methods. JSON is more loosely defined in comparison to XML. Depending on your needs either XML or JSON should work well.

You're going to have at least 54 combinations, so if you're not open to a database, then I'd probably go for XML. Since it should be fairly straight-forward in that it's only reading (unless you're going to be adding files and they won't be static), then you could use PHP's simple_xml set of functions. A CSV can work just as well, however, I would use an uncommon delimiter, such as || just so any punctuation, ' ' or " " don't ruin it.