-
Session variable....
I am doing little web development these days.... and stuck at a stage where i got stuck a while ago but couldn't find the right answer...... Now can you gals/guys help me out here.
I have created a Login page from where a user can access the rest of the website. After entering the right credentials the user goes to a page from where he/she select the desire option and then they have been taken to that final page where they enter some data and submit it.
LoginPage=>selection page=>Form
What i want to achieve is that when the user enter his login credentials (username) that name shoud come in the form page filed "name". These pages are design in ASP with javascript.
Tell you one more thing i am not a programmer, so all i am doing this via Ultra Dev. What i know is that i have to somehow pass session variables, but not much sure how so any help in this would be highly appreciated as i have been looking for this solution from quite a long time with no luck so far :-(
-
hmm. Too bad you didn't ask the same question about php. I, probably many others, would have answered it a while ago. It looks like all you do to store session information is this:
Session("user") = "John Smith";
I guess once you do that you can use Session("user") throughout the session to access the username "John Smith". That's probably not all the info you wanted, but a quick search should get you there. Good luck.
-
Hey Hey,
You shouldn't have to set a session variable if you're just passing from one page to another..
You could use post variables...
I'm assuming that your form specifies method="POST" and in that case using ASP you can Request.Form. So if you have "posted" the information using the form field 'name'. Then you could Request.Form("name").
You can get more information on working with forms in ASP from http://www.elated.com/tutorials/programming/asp/forms/
Peace,
HT
-
HTRegz
I have managed to achieve this thing with your help, but for this i have to made a little adjustment. Anyways now the problem is as i have said earlier i am using Ultra Dev and there is an option in it "Server Behaviors" and in server behaviors Log In User. So i am using this option to create login.asp page with fields Username and password and method for form submission POST.
When i put Request.Form("username") on the next page i can't see any text written there,
although it should show user name enter on login screen.
So to check whether the information is getting pass in b/w pages i simply remove this server behavior and use POST method in the login.asp page and on passed the information to that forms.asp page and YEAP i could see the Request.Form("username") is working in this way so whatever i enter on login.asp username field i get it at forms.asp page.
Now the question as i have to create a login page so i have to include that server behavior in login.asp page so why this Request.Form("username") is not working in this method?
I have attached both Login.asp & forms.asp Coding with the DB see if you find the error.
-
There's a slight difference in getting the variables with a GET or a POST method..
This may help:
http://www.asptutorial.info/sscript/GetandPost.asp