QueryString issue

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DaveRook
    New Member
    • Jul 2007
    • 147

    QueryString issue

    Hi

    Can I check if a querystring is null (ie, doesn't exist) compared to one which is empty?

    In 'English' I want the statement to say:

    If the querystring is present but empty then
    n = true
    end

    This is for a validation page. The issue I have is the querystring may or maynot be present in the URL.

    Code:
    if Request.QueryString("aaa") <> null AND Request.QueryString("aaa") = "" then
    		n = true
    end if	
    
    Response.Write("The answer is " & n)
    This doesn't work. I don't get a result at all. It's almost as if vbscript sees null and empty as the same thing.

    Any ideas?

    Dave
  • DaveRook
    New Member
    • Jul 2007
    • 147

    #2
    Originally posted by DaveRook
    Hi

    Can I check if a querystring is null (ie, doesn't exist) compared to one which is empty?

    In 'English' I want the statement to say:

    If the querystring is present but empty then
    n = true
    end

    This is for a validation page. The issue I have is the querystring may or maynot be present in the URL.

    Code:
    if Request.QueryString("aaa") <> null AND Request.QueryString("aaa") = "" then
    		n = true
    end if	
    
    Response.Write("The answer is " & n)
    This doesn't work. I don't get a result at all. It's almost as if vbscript sees null and empty as the same thing.

    Any ideas?

    Dave
    Sorry

    There was another mistake else where on the page which affected the result. Sorry all, please ignore this post

    Comment

    Working...