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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Session variable

Status
Not open for further replies.

gabui

Programmer
Joined
Dec 5, 2003
Messages
2
Location
GB
How do I set a session variable on a .aspx page
OS XP and Access database on dreamweaver MX
I'm using the code
<%Session(&quot;SUser&quot;)=Request.Form(&quot;txtUName&quot;)%>
Where txtUName is input by the user and verified as existing in the database (that works)
Where does the code need to be and can I set it on a page with frames?
Any help ?
 
in the same page right under the recordset used to filter/look for username
Code:
....the reocrd set and sql....
ExistingUsers_numRows = 0
%>

<!--  Redirect potential new user to &quot;RegisterFailed.asp&quot; if offered username is already in use -->

<%' Redirect new user if UserName is in use 
      If NOT ExistingUsers.EOF Then
        Response.Redirect(&quot;RegisterFailed.asp&quot;)
       ELSE
  %>
<% End If %>
<% ' Make a session variable from entered UserName if it is now valid
   Session(&quot;svUserName&quot;)= Request.Form(&quot;tfUserName&quot;) 
%>
All the best!

> need more info?
:: don't click HERE ::
 
Many thanks Got it!
 
Lebisol,

Similar question with regards.

Would I make a hidden field in the posting form and add the Remote.Addr be assigned to it the call a request.form to set it to session variable. Not really up to speed yet.
 
ones session is made u don't need to &quot;hide it&quot; in order to pass it like tokens....which is exactly what makes sessions so great.....all u have to do is call it later (at any time on any page) and use it....to test that u have it created just make any page that follow the creation and use Response.Write(&quot;<%= svUserName %>&quot;)

All the best!

> need more info?
:: don't click HERE ::
 
Thanks Lebisol,

I know how to call them just was/am not sure how to instate the server variables to session variables guess the prior post was off a tad.

Dostani
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top