check if query string is emtpty

Results 1 to 4 of 4

Thread: check if query string is emtpty

  1. #1
    Tobias Brandvik Guest

    Default check if query string is emtpty

    I have a page called index.asp that I want to do two things..:<BR><BR>1) If the Request object contains no querystring I want it to display the latest article in the database.<BR><BR>2) If the querystring is not empty it will contain a date. If this is the case, the page should display the article that corresponds to the date. <BR><BR>Getting the records from the database is not a problem. What I don&#039;t know what to do is to check if there is a querystring or not. How can I do this?

  2. #2
    Join Date
    Dec 1969
    Posts
    758

    Default If (Len(Request.QueryString) <> 0) Then

    .

  3. #3
    Join Date
    Dec 1969
    Posts
    100

    Default Anyone else

    please feel free to correct me if I am wrong....<BR><BR>Try:<BR><BR>Dim qString<BR>qString = Request.ServerVariables("QUERY_STRING")<BR>if(qStr ing = "")Then<BR> Response.Write "No querystring"<BR>Else<BR> Response.Write "QueryString present"<BR>End If

  4. #4
    Join Date
    Dec 1969
    Posts
    100

    Default Yup, much more elegant...

    I stand corrected :)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •