Session Variable to Search Database Nightmare

Results 1 to 3 of 3

Thread: Session Variable to Search Database Nightmare

  1. #1
    Join Date
    Dec 1969

    Default Session Variable to Search Database Nightmare

    I was wondering if any of you wizards can help me.<BR><BR>On one of my pages I am storing a users IP address in a session variable (svIP). When the user moves to another page, I am using the session variable to query a table in my database (uprofiles). If they have pre-registered on the next page their user details should come up. BUT..... How, if they haven&#039t registered do I stop the error message coming up that says the item has been deleted, and redirect them to the a user registration page (register.asp). <BR><BR>Any help/advice would be greatly aprreciated,<BR>Gavin Beddow

  2. #2
    Sateesh Guest

    Default RE: Session Variable to Search Database Nightmare

    why you need to store the ip address in the session you can very well find it out from the server variables (REMOTE_ADDR), when the user submitts check the ip against the database and retrieve the data corresponding to those ip address. when there or no records (when the recordset is either bof or eof) then redirect him to the register page, if there are corresponding data redirect him to the other page.<BR><BR>like<BR><BR>If not RS.bof or not Rs.eof then<BR> &#039view user profile<BR>else<BR> &#039registration page<BR>end if

  3. #3 Guest

    Default RE: Session Variable to Search Database Nightmare

    I&#039m not sure exactly what the problem is, but I think this MAY help...<BR><BR><BR>(on the page that checks if they have registered)<BR>-------------------------------------------------------------<BR>SQLstmt = "Select * from Clients where IPAddress=&#039" & Session("svIP") & "&#039;"<BR><BR>Set rsClients = Conn.execute (SQLstmt)<BR><BR>If rs.eof then<BR> Response.redirect "register.asp"<BR>Else<BR> ShowDetails()<BR>End IF<BR>------------------------------------------------------------<BR><BR>ETC ETC.<BR><BR>Hope this helped.<BR><BR>Regards,<BR><BR>James Andrews.<BR><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