Getting and using ? variables from the URL

Results 1 to 2 of 2

Thread: Getting and using ? variables from the URL

  1. #1
    Peter McCabe Guest

    Default Getting and using ? variables from the URL

    I have a simple login screen which validates a user against a DB.<BR><BR>If it returns the user as an administrator then redirect to admin pages otherwise go to elsewhere.<BR><BR>Have managed to get the ?userid=1234 part concatenated to the URL, but now how can I format the output of that page using that variable?<BR><BR>I have tried:<BR><BR>&#060;%<BR>myVar= UserID<BR>response.write(myVar)<BR>if myvar = 1234 then<BR>do something<BR>etc etc etc etc<BR>end if<BR>%&#062;<BR><BR>Have had no luck.<BR><BR>I have seen it done on a million web sites (like this one!) but have had no luck understanding the way in which they work.<BR>Thanks again

  2. #2
    Join Date
    Dec 1969

    Default RE: Getting and using ? variables from the URL

    Change the line<BR><BR>myVar= UserID<BR><BR>to<BR><BR>myVar= Request.Querystring("UserID")<BR><BR>It looks like the code your posted isn&#039t enumerating UserID. Remember that asp variables are case sensitive.<BR>

Posting Permissions

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