I'm working on a product catalog, so to speak, and in it, I need to grab the product line ($line) from the url and display the appropriate bit of data, which I've got it doing. Right now, it's set up something like this:
<?php
// get $line (product line) from url
$line=$_GET['line'];
switch($line) {
case "product_1" :?>
<h3>Product Number 1</h3>
<p>blah...</p>
<?php break; case "product_2" :?>
<h3>Product Number 2</h3>
<p>blah as well...</p>
etc...
?>
This all works well for me. However, I thought it might be easier to load the product data into each case by looping through a pipe delimited flat file (I unfortunately don't have access to mysql), something like:
1|product_1|Product Number 1|blah...
2|product_2|Product Number 2|blah as well...
etc...
Is there a more efficient way to do this?
Thanks in advance,
gen