Click to See Complete Forum and Search --> : [RESOLVED] Trying to get ASP form to work


austenr
05-23-2007, 12:45 PM
Hi,

I am trying to learn how to do this. I have the following HTML code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Process form data with Post method</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form method="post" action="process.asp" name="form1"
<table width="70%" border="0" cellspacing="0" cellpadding="0"
<tr>
<td>name:</td>
<td colspan="2"><input type="text" name="name"</td>
</tr>
<tr>
<td>email:</td>
<td colspan="2"><input type="text" name="email"></td>
</tr>
<tr>
<td>comments:</td>
<td colspan="2"><textarea name="comment" cols="40" rows="5"></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2"><input type="submit" name="Submit" value="Submit"</td>
</tr>
</table>
</form>
</body>
</html>


Which works with no problem until I hit the submit button. When I do I get a message box asking if im sure I want to open the ASP page.

ASP Code:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Submitted Data</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim name,email, comment
name=Request.Form("name")
email=Request.Form("email")
comment=Request.Form("comment")
response.write("Name: " & name "<br>")
response.write("Email " & email "<br>")
response.write("Comments: " & comment & "<br>")
%>
</body>
</html>


I know that this is simple example to a lot of you but I don't know what I am doing incorrectly. Thanks

BTW - both examples are in the same folder on a server.

nathanb
05-24-2007, 01:27 AM
If you get a dialog prompting you to download the .asp page then you don't have ASP installed correctly on your server.

Terrorke
05-24-2007, 01:36 AM
Make sure your asp is configured correctly.
At this point asp is not working on your server (like nathanb is saying)

You can check this by creating a page with the code
<%
response.write("hello World!!")
%>

If you see it on your screen, asp is working

austenr
05-24-2007, 05:35 AM
Thank you. I had to install IIS and that fixed it.