我有以下形式,ASP:request.form没有返回值?
<form action="contact_us.asp" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input name="firstname" type="text" id="firstname" size="30" />
<input name="lastname" type="text" id="lastname" size="30" />
<input type="submit" name="submit" id="submit" value="Submit" />
</form>
但是,当我试图让我的ASP文件contact_us.asp这些后变量的值,然后返回空白。代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<%
Dim FirstName, LastName, Email, Message
FirstName = request.form("firstname")
LastName = request.form("lastname")
response.write(FirstName & "OK")
%>
它只返回“OK”给我。 Message变量中什么都没有?
请帮我,告诉我这里有什么问题?
?在上面的HTML中没有''(或者'email')。 – bobince 2010-09-06 08:05:34
当我从HTML标记中删除'enctype =“multipart/form-data”'时,它的工作正常并返回值。 –
Prashant
2010-09-06 09:22:05
如果您不需要进行文件上传,您可以删除enctype =“multipart/form-data” – Cris 2010-09-06 09:28:05