Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Community Forums
 Community Discussions (All other subjects)
 Question on Value?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
JJenson Posted - 24 June 2008 : 19:11:44
Ok so I have a form that is pulling in through a quearystring a value for a field. This is what I have for it:

This is the code to get the referer


<%

Dim Referer : Referer = Request.ServerVariables("HTTP_REFERER")
Dim Location

Select Case(InStr(Referer, "http://www.jiffylube") > 0)
Case True: Location = Mid(Referer, 21, InStr(21, Referer, ".") - 21)
Case Else:
End Select

%>



<input type="text" value="<%=Location%>" size="20" name="Location" readonly />

What I need to modify this is basically say if location=nothing then show na

I just can't get it right.<
5   L A T E S T    R E P L I E S    (Newest First)
JJenson Posted - 25 June 2008 : 14:30:58
Well in the end they told me its ok to leave it as they though someone could delete the number if it was populated. But I told them it is not possible as it is a read only field they think they are getting this error through another form. So I guess in the end I didn't need it lol.

But I can see where you are going with it Gary I believe it would work but no longer need it thanks though.<
gary b Posted - 25 June 2008 : 12:23:10
quote:
Originally posted by JJenson
Dim Referer : Referer = Request.ServerVariables("HTTP_REFERER")
Dim Location

Select Case(InStr(Referer, "http://www.jiffylube") > 0)
Case True: Location = Mid(Referer, 21, InStr(21, Referer, ".") - 21)
Case Else:
End Select

What I need to modify this is basically say if location=nothing then show na


JJ...
My usual disclaimer: I only sometimes have a clue about what you want to know!

Why not intercept the process? Once you populate Referer, test it.
IF Referer="" THEN
Location = NA
ELSE
'Do nothing
ENDIF


Obviously, remainder of code would have to match this approach. My point is that you are focusing on Location when, I believe, your focus should be on Referer.

Any merit in this idea?

gary b
<
AnonJr Posted - 25 June 2008 : 07:18:51
quote:
Originally posted by phy1729

Also if there's no reason to use a select case consider using an if then. I cringed.
Sure there is - if you know that there's going to be a need to add more later on, a Select Case tends to be a little more readable than an endless ElseIf chain. (Your preferences may vary.)

Even if there isn't, I find what he's doing to be much more readable - and therefore maintainable - than some of the convoluted If .. Then bits I've seen floating around. More and more I'm coming to the conclusion that there's a fool's economy in sacrificing maintainability in the name of machine performance. Hardware is cheap, programmer time isn't.<
phy1729 Posted - 24 June 2008 : 22:51:57
Did you try If location = "" then location="na" end if? Also if there's no reason to use a select case consider using an if then. I cringed.<
JJenson Posted - 24 June 2008 : 22:42:06
Any Ideas?
<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000 Version 3.4.07