how would i set a session in this script

Results 1 to 2 of 2

Thread: how would i set a session in this script

  1. #1
    Join Date
    Dec 1969

    Default how would i set a session in this script

    i want to store the id number as a session so i can call it up later on in another script like this session"id"<BR><BR>i have tried this (in the script below) but it dosent work session"id"= rs("id")<BR><BR><BR>&#060;% <BR> email=Trim(request.form("email")) <BR> txtpassword=Trim(request.form("txtpassword")) <BR> &#039;email="aron"<BR> &#039;txtpassword= "abu"<BR> <BR> sql="SELECT * FROM users WHERE email=&#039;"&email&"&#039; AND txtpassword=&#039;"&txtpassword&"&#039;" <BR> <BR> set db=Server.CreateObject("ADODB.Connection") <BR> db.Open"dbtest" <BR> set rs=Server.CreateObject("ADODB.RECORDSET") <BR> rs.Open sql, db, 3, 3 <BR> &#039;geogra=(rs.Fields("geog")) <BR> If Rs.EOF Then <BR> &#039; Die Login-Informationen sind falsch. <BR> Response.Redirect "errorlogin.htm"<BR> &#039;Response.Write("login=failed") <BR>Else <BR> geogra = rs("geog") <BR> id = rs("id")<BR> session"id"= rs("id")<BR> If Len(Trim(geogra & "")) &#062; 0 Then <BR> Response.Redirect geogra & ".asp?id=" &id<BR> Else <BR> &#039; Die Login-Informationen sind korrekt. <BR> Response.Redirect "map.asp?id=" &id<BR> End If <BR>End If <BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: how would i set a session in this script

    Your syntax is wrong. The syntax is <BR><BR>session("id") = Value<BR><BR>But anyway, you should try<BR><BR>session("id") = rs.Fields("id").Value<BR><BR>This will store the value of the field, not the pointer to the field. So when you close the recordset, it won&#039;t point to NULL.<BR><BR><BR>Check out <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