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!

Passing user input to another page?

Status
Not open for further replies.

99mel

Programmer
Oct 18, 1999
379
GB
I have 2 text boxes on a page (loginname and password). All i want to do is when the user clicks the button named 'Login', the loginname and password are sent to another web page. This is actually a ASP page which i'm connecting to a SQL database, i want to use the loginname and password the user typed in to connect to the database.

Any help much appreciated!!

Thanks!
 
ok... so i have the textbox which is named 'loginname'. I click the submit button which then simply loads up an asp page.

Whats the html that i need to use to bring back the value that was in the textbox 'loginname'

thanks again!

 
you can start with
<%
response.write loginname
%>

to display the value.
 
ok i've got this working now...

problem is, i'm passing a username and password which i then use to connect to a db. I can't really do it this way because u can see the variables in the http file name i.e the password.

How can i overcome this problem?
 
Form page:

<form method=post action=page1.asp>
<input type=text name=loginname>
<input type=password name=password>
<input type=submit>
</form>

page1.asp:

<%
'this way the values are now stored in the login and
'password variables. NOT VISIBLE TO USER

login = request.form(&quot;loginname&quot;)
password = request.form(&quot;password&quot;)
%>

Now all you have to do is connect to the DB, or do whatever you want with those variables.

Hope this help,

Nite
 
wohoo :)

so all i'm doin now is using the method=&quot;post&quot; instead of &quot;get&quot;, whats the difference apart from not showing it to the user?

thanks!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top