Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Need help accepting url passed variables

Quote Reply
Need help accepting url passed variables
I've wracked my brains and searched the forums up and down. I'm using statically built pages in LinksSQL 2.x and need the search.html and search_results.html to change headers based on the catid I'm passing through the search.cgi url string.

For example, ../search.cgi?catid=64 will trigger the following template code:
<%if catid eq '64'%>
to include the file CJ_header_cats.html

Fine and dandy. Now the problem. I need to do the same for catid 64 through 90 plus 122. Catid 95-121 and 123 need to call a separate file, with all the other catids using the default.

I've tried
<%if catid ge '64' and le '90'%>
... CJ_header_cats.html
<%esleif catid eq '122'%>
... CJ_header_cats.html
<%elseif catid ge '95' and le '121'%>
... XJ_header_cats.html
<%esleif catid eq '122'%>
... XJ_header_cats.html
<%else%>
...include_header.html
<%endif%>

That didn't work. Tried using <=, <= and == operators. No go. The code only honors the 'eq' comparison. Is there a way to use range operators in this application?
Kevin

My Green Promise: To learn (and practice) as much as I can about living a sustainable life and then spreading the word.
What's your Green Promise?
Quote Reply
Re: [kthull] Need help accepting url passed variables In reply to
Hi,

A few things =)

>= <= == etc can ONLY be used for numbers. Quoting them can confuse the template system =)

Also, when using "and" to join them, you have to re-define the "catid" variable, i.e if catid >= 64 and catid <= 90).

Code:
<%if catid >= 64 and catid <= 90%>
... CJ_header_cats.html
<%elsif catid == 122%>
... CJ_header_cats.html
<%elsif catid >= 95 and catid <= 121%>
... XJ_header_cats.html
<%elsif catid == 122%>
... XJ_header_cats.html
<%else%>
...include_header.html
<%endif%>

Hope that helps.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Need help accepting url passed variables In reply to
Thanks so much Andy. That did it.
Kevin

My Green Promise: To learn (and practice) as much as I can about living a sustainable life and then spreading the word.
What's your Green Promise?