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

request.form variables empty

Status
Not open for further replies.

MikeL91

Programmer
Feb 8, 2001
100
US
I am posting from a html page to a asp page, and for somereason my variable are empty after the post.

Here is the begin of the html code:

<form action=&quot;contact.asp&quot; method=&quot;post&quot;>
<br>
<div align=&quot;center&quot;>
<table border=&quot;1&quot;>
<tbody>
<tr>
<th>First Name:</th>
<th><input name=&quot;First&quot; size=&quot;20&quot;></th>
</tr>


here is the asp code:

<%@ Language=VBScript %>
<% Response.Buffer = True %>
<%
'Author: Mike
'Last Change: 2001JUl29 ML
'
Response.Write &quot;*After session check &quot;+Request.Form(&quot;First&quot;)
'


All is see is : *After session check

no first name?

any sugestions/help is always appreciated.

-Mike
 
try testing it to make sure it is going through
var1 = Request.Form(&quot;First&quot;)
response.write var1 I help at your own risk, if I brake it sorry! But if I fixed it, let me know.[thumbsup2]
admin@onpntwebdesigns.com
 
I tried that code in the begining of the asp page, but it prints nothing on the screen. I know now that it is not going through, but have no idea why. I thought it is a very simple thing, post, action=asp page, not much to it, any idea why it is not bringing any request.form data to the asp page it is posting to?
 
I have to ask but how are testing your asp pages? terhre's nothing wrong with the small section you pasted.
try testing with this to make sure the asp is being read properly
test.htm code
<html>
<body>
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;test.asp&quot;>
<input type=&quot;text&quot; name=&quot;first&quot;>
<input type=&quot;submit&quot; value=&quot;submit&quot;>
</form>
</body>
</html>
test.asp code
<%
dim var1
var1 = request.form(&quot;first&quot;)
response.write var1
%>
let me know what happens. Are you using IIS or PWS to test asp pages? I help at your own risk, if I brake it sorry! But if I fixed it, let me know.[thumbsup2]
admin@onpntwebdesigns.com
 
It's not your form, it's your string concatenation.

The operator for concatenation is &, not +.

Change the line

Response.Write &quot;*After session check &quot;+Request.Form(&quot;First&quot;)

to

Response.Write &quot;*After session check &quot;&Request.Form(&quot;First&quot;)

and it will all work fine.
 
dds82, good eye But the test did not work as well. I think it is a testing convention issue also I help at your own risk, if I brake it sorry! But if I fixed it, let me know.[thumbsup2]
admin@onpntwebdesigns.com
 
I moved the FORM line up 3 lines and it works????

go figure.


Thanks for all your guys help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top