Results 1 to 5 of 5

Thread: Session variable....

  1. #1
    Did someone said Pizza :) FanacooL's Avatar
    Join Date
    Oct 2004
    Location
    Karachi , Pakistan
    Posts
    466

    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 :-(
    One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man!

  2. #2
    Elite Hacker
    Join Date
    Mar 2003
    Posts
    1,407
    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.

  3. #3
    Senior Member
    Join Date
    Jan 2003
    Posts
    3,915
    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

  4. #4
    Did someone said Pizza :) FanacooL's Avatar
    Join Date
    Oct 2004
    Location
    Karachi , Pakistan
    Posts
    466
    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.
    One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man!

  5. #5
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    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
    Oliver's Law:
    Experience is something you don't get until just after you need it.

Posting Permissions

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