|
-
Feb 28th, 2001, 06:44 AM
#1
Thread Starter
Member
Hey Guy's ..
Yes it it I ... Again .... With another problem for the Dev-Demmie-Gods 
So to begin here's my code:
*************
'Checks the Session Variable "State" to see if user used correct route to enter the Site'
chSession = Trim(Session("state"))
chString = Trim(Request.Querystring("sStatus"))
if chSession <> chString then
Response.Write "It didn't worked"
Response.End
'Response.Redirect "http://www.newsclip.co.za/asp/temp.html"
Else
Response.Write "It worked<br>"
End If
*************
Now what this code is supposed to to is this ....
The Session("status") is a Random number red into the Session ("status") variable ...the same variable is read into the Querystring .. the idea behind this is that a User has to through a certain page so that the Audit trail can be invoked.
Now my problem is that no matter what opperator I use = or <> I can't seem to be able to compare them .. I wrote them into the same page and they are the same .. In thought that there might be a problem with Spaces that's why i used the Trim() ..
You can test this here:
http://www.newsclip.co.za/clients.asp
Thanks in Advance!
Last edited by Randhart; Feb 28th, 2001 at 06:49 AM.
;-)
Jaco
South-Africa
-
Feb 28th, 2001, 08:16 AM
#2
Frenzied Member
hummm
try converting them to string:
if CStr(chSession) <> CStr(chString) then
-
Feb 28th, 2001, 09:05 AM
#3
Frenzied Member
This works:
Code:
<%@ Language=VBScript %>
<html>
<body>
<%
chSession = Trim(Session("state"))
chString = Trim(Request("sStatus"))
Response.Write chSession & "<BR>"
Response.Write chString & "<BR>"
if chSession = chString then
Response.Write "It worked<br>"
Else
Response.Write "It didn't work"
End If
%>
</BODY>
</HTML>
-
Mar 1st, 2001, 01:20 AM
#4
Thread Starter
Member
Thanks Guy's 
It worked out perfectly!!!! .. I combined both of your solutions!!!
Cheers vir eers!
-
Mar 1st, 2001, 03:25 AM
#5
Frenzied Member
Okey dokey!
The problem was your syntax in Request.Querystring("sStatus")) which was returning and empty string when I tried it.
converting them to strings as well is probably not necsesary.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|