<!--root.htm中的程序-->
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网页例子</title>
<script language=vbs runat=client>
</script>
</head>
<body>
<form name=form1 method="POST" action=root.asp>
<table border="0" width="60%" id="table1">
<tr>
<td width=50 style="font-size: 2" align="right"><font size="3">a=</font></td>
<td width=100><input type="text" name="T1" size="20" value=0></td>
<td width=50 align="right">b=</td>
<td width=100><input type="text" name="T2" size="20" value=0></td>
<td width=50 align="right">c=</td>
<td width=100><input type="text" name="T3" size="20" value=0></td>
</tr>
</table>
<p align="center"><input type="submit" value="提交" name="B1"> <input type="reset" value="重置" name="B2"></p>
</form>
</body>
</html>
<!--root.asp中的程序-->
<%
dim a,b,c,d,n,x1,x2
a=CSng(Request.Form("T1"))
b=CSng(Request.Form("T2"))
c=CSng(Request.Form("T3"))
d=b*b-4*a*c
Response.Write "<font face=隶书 size=2>"
Response.Write "方程;"
Response.Write "a=" & a & ",b=" & b & ",c=" & c & "<br>"
if d<0 Then
Response.Write "没有根"
elseif d=0 then
Response.Write "一个根"
x1=(-b-sqr(d))/(2*a)
Response.Write "x1=" & x1
else
Response.Write "两个根"
x1=(-b-sqr(d))/(2*a)
Response.Write "x1=" & x1 & " "
x2=(-b+sqr(d))/(2*a)
Response.Write "x2=" & x2
end if
Response.Write "</font>"
%>
执行 root.htm 点“提交”为什么结果总是不对。。(在页面中显示root.asp的内容)
正确结果应该显示:
方程:a=2,b=-4,c=2
一个根:x1=1
执行完的结果是这个。。
不是在设计视图中打开的。。 就是在代码区打开的。。IIS我也装了。。
2.要用IIS来跑这个程序 浏览器自己解释不了
The system uses the widely used ASP, SQL2005, Dreamweaver8 related technologies, designed a user-friendly, more humane prominent feature simple and quick and more practical BLOG. Authorized, the administrator can be registered through the WEB browser, the system back to the realization of human-computer interaction on the registered blog user management, account management, links to management. Blog user in the foreground can manage their own blog space, including the release of their web logs, and related personnel exchanges and communication, and delete the comments and other visitors. In addition, the visitors through registration, log into the blog space for comment. Visitors not registered by an anonymous comment on the blog space.