[thelist] Logic headache

Tony Crockford tonyc at boldfish.co.uk
Mon Nov 11 09:10:00 CST 2002


Hi all,

brief explanation:

I'm building a select list in PHP, to exclude certain directories from a
search
(with Ht://dig).

The structure is like this:
<select name="exclude">
<option value="">All levels</option>
<option value="/lv2/|/lv3/|/lv4/">Level 1</option>
<option value="/lv1/|/lv3/|/lv4/">Level 2</option>
<option value="/lv1/|/lv2/|/lv4/">Level 3</option>
<option value="/lv1/|/lv2/|/lv3/">Level 4</option>
</select>

for four levels, where the option value should be all lv's except the
current option level.

I have a variable $maxlevels to count up to however many levels are
required and  I want to make this select list work based on the value of
$maxlevels.

How would you approach the building of the list?

I was going to use a while loop or two, but I'm stuck at the point of
creating the value "string" which should contain all the levels from 1
to $maxlevels except the current level. which would seem to require some
sort of conditional "if $thislevel string is" type of approach, but I
can't get my head round it.

Anyone put me out of my misery?

Thanks

Tony

--
http://www.maccaws.org/
[Making A Commercial Case for Adopting Web Standards]




More information about the thelist mailing list