Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Best parameter when no option is selected

         

stevelibby

2:38 pm on Mar 21, 2008 (gmt 0)

10+ Year Member



What is best if an option is not selected:
Category=
Or
Category=Any
or
Category=0

I prefer the first, but whats good for g?

tedster

2:53 pm on Mar 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I assume you're talking about generating a url here? I think the critical factor in that case is what content the option generates - but the actual parameter you use would not make any difference as far as I know.

Bewenched

4:41 pm on Mar 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



CATEGORY=NULL

is what i use sometimes. I generally dont like leaving them blank if I can help it.

g1smd

9:48 pm on Mar 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What happens if I completely omit the parameter?

What content and status code do you then serve?

jd01

12:38 am on Mar 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think what g1smd might be getting at with the question is:
Omit the parameter and use some mod_rewrite, especially if you have a number of parameters.

Personally, if I use parameters I like to keep my variable names short, and their values descriptive:

EG
C=Index
C=Green-Widgets
C=Widgeting

NOT
Category=I
Category=GWs
Category=Wdgtng

Why?
Values change on a 'page-by-page' basis, but variables remain constant.

Which is more accurately descriptive for a URL?
?C=Green-Widgets&P=1
?Category=GW&Page=1

Think about how you would structure your site with directories and what you would use as descriptors for directories / pages, then make those your values.

(/=Variable : Directory=Value :: /Green-Widgets/1 = C=Green-Widgets&P=1)

Justin