Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what's good way to pass variables?

Status
Not open for further replies.

ralph4208w

Programmer
Aug 29, 2006
13
US
Hi,

I'd like my site to check if a user is logged in. If she/he is not logged in, then redirect the page to a login page, and eventually come back to the originally requested page.

Let's say I have: main.asp?this=2&that=4
the system will see that a login is needed, go to the login screen, see a cookie, redirect to a page that logs the user's entrance, and then finally redirect back to the main page.

What is a good way to pass a querystring as a parameter and then load it later. For example, the login page would see this url: /login.asp?main.asp?this=2&that=4

What is the easiest way to handle this?

Thank you in advance!

sites I like: .. let's me find new movies to watch :)
 
you could use a session variable or just pass the extra stuff along in the QueryString... having extra stuff up there wont hurt as long as (1) doesnt get too long and (2) no passwords or other secret data up there in plain text.
 
Thanks for the reply. Yes, I want to pass it as part of the url. My question: What is the best way to format a passed variable, when the variable contains characters that could be percieved as part of the url? (What is a good way to escape the url characters "&" and "?" when they're part of a variable?)


sites I like: .. let's me find new movies to watch :)
 

server.urlencode

A smile is worth a thousand kind words. So smile, it's easy! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top