School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,118 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,969 people online right now. Registration is fast and FREE... Join Now!




checking lists in url

 

checking lists in url

sukiho

21 Oct, 2009 - 02:30 AM
Post #1

New D.I.C Head
*

Joined: 21 Oct, 2009
Posts: 3

Im doing some work on an already built site and I want to see if a name is already in a list which gets sent thru the url, say like this where one is the name and I want to see if its already in the list, which it is in this case -

page.cfm?Name=one &theList=one,two,three

the code used isnt working but it would seem something like this should, but it isnt -

CODE
<cfif  listContains(url.theList, "url.Name")>


any ideas? thanks



User is offlineProfile CardPM
+Quote Post


ecuscotty

RE: Checking Lists In Url

21 Oct, 2009 - 06:42 AM
Post #2

New D.I.C Head
*

Joined: 14 Oct, 2009
Posts: 40



Thanked: 5 times
My Contributions
Hello,

Try something like...

CODE

<cfif  listContains(url.theList, #url.Name#) neq 0>


You were looking for the literal string "url.Name" in the list, but what you really want is to look for the value of the url.Name variable.

Good Luck.

This post has been edited by ecuscotty: 21 Oct, 2009 - 06:43 AM
User is offlineProfile CardPM
+Quote Post

sukiho

RE: Checking Lists In Url

21 Oct, 2009 - 09:01 AM
Post #3

New D.I.C Head
*

Joined: 21 Oct, 2009
Posts: 3

thanks, I think that works but the problem seems to be that I get a space after the word in the url, as in my example after one -

page.cfm?Name=one &theList=one,two,three

and that seems to throw it off, I have tried <CFPROCESSINGDIRECTIVE SUPPRESSWHITESPACE="Yes"> but doesnt seem to change it

actually it works fine in english, its when i use a language like thai that it adds white space

This post has been edited by sukiho: 21 Oct, 2009 - 09:16 AM
User is offlineProfile CardPM
+Quote Post

sukiho

RE: Checking Lists In Url

21 Oct, 2009 - 09:51 AM
Post #4

New D.I.C Head
*

Joined: 21 Oct, 2009
Posts: 3

this seems to work, thanks for the help
CODE
<cfif  (listContains(url.theList, trim(#url.Name#))neq 0)>


This post has been edited by sukiho: 21 Oct, 2009 - 10:00 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 01:36PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month