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

passing values to variables

Status
Not open for further replies.

Samalia

Technical User
Jun 7, 2005
46
CA
I'm trying to get a variable to get the value from a textbox created in Dreamweaver that has already been defined and called username.

<% session("varuser") = Request.Form("username") %>

This is what I'm using to get the value from the textbox. I'm using vbscript. It doesn't seem to be getting the value from the texbox and then sending it to the next page because on the next page when I try to call up the variable nothing appears on the page.
<%= request("varuser") %>

This is what I'm using to display the variable's value.
 
Hey Samalia,

Unless you are submitting the form to itself, the line:

<% session("varuser") = Request.Form("username") %>

has to be on the next page that you are submitting the form to. Other than that, that piece of code looks right.

When you are using the output ASP code, use:

<%=Session("varuser")%>

You can use this on the same page where you capture the Request.Form("username"). Just make sure you establish the session variable before you call on it in the code.

Hope this helps.

-JP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top