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

send form result to asp page 2

Status
Not open for further replies.

JohanF

Programmer
Aug 29, 2002
6
SE
Hi

How do I pass the information from a form to a text file (or another asp file) on my server?
The only variable I need is the users name
<input name=yourname>
so infact the only thing I need on my new page is the name (&quot;yourname&quot; ) the user typed in my form.

Please..I'm an asp beginner, so I would appreciate some example code! :)

 
On the input name page:

<form action=&quot;nextpage.asp&quot; method=&quot;post&quot;>
Please enter your name
<input type=&quot;text&quot; name=&quot;Name&quot;>
<input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;submit&quot;>
</form>


Then on nextpage.asp (or whatever your page is called) you can access the variable via:

Request.Form(&quot;Name&quot;)

or alternatively Request.QueryString(&quot;Name&quot;) (when the form method is set to &quot;GET&quot;).

You can then assign it to a variable i.e.

Dim username
username = Request.Form(&quot;Name&quot;)

or show it on the screen:

Response.Write &quot;Request.Form(&quot;Name&quot;)

or whatever you need to do.

Hope this helps!
Nick (Web Developer)


nick@retrographics.co.uk
 
I suppose your are trying to remember the user what's the username he just entered, if that's what you're trying to do you just have to decalre a variable that requests the value entered on the input field:

<input name&quot;username&quot;>

<% strUsr = request(&quot;username&quot;)%>

...
<td>Your Username is:</td>
<td><%= strUsr %></td>

Hope this helps you

Herminio, Portugal

 
Thanks HowardMarks and Herminio!!

This really solved my problem! :)
/Johan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top