| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1476 人关注过本帖
标题:关于request.form问题(错误:函数需要字符串输入)
取消只看楼主 加入收藏
51684444
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-5-26
收藏
 问题点数:0 回复次数:1 
关于request.form问题(错误:函数需要字符串输入)
Request 对象, ASP 0102 (0x80004005)
函数需要字符串输入。
/Untitled-5.asp, 第 13 行
我的意思是,在表单上输入年龄和岁数。根据输入表单里年龄和性比来判断输出小妹妹还是小弟弟等


<%
dim sex,age

if request.form (sex)="男" then
if request.form (age<8) then
response.Write("小弟弟")
else
if request.form (age>=8 and age<=15) then
response.Write("小男孩")
else
if request.form(age>=16 and age<=24) then
response.Write("小伙子")
else
if request.form(age>=25 and age<=45) then
response.Write("青年男子")
else
if request.form(age>=46 and age<=55) then
response.Write("中年男子")
else
if request.form(age>=56 and age<=80 )then
response.Write("老爷爷")
else
if request.form(age>80) then
response.Write("老寿星")
end if
end if
end if
end if
end if
end if
end if
else
if request.form (age<8) then
response.Write("小妹妹")
else
if request.form (age>=8 and age<=15) then
response.Write("小女孩")
else
if request.form (age>=16 and age<=24) then
response.Write("小姑娘")
else
if request.form(age>=25 and age<=45) then
response.Write("青年女子")
else
if request.form (age>=46 and age<=55) then
response.Write("中年女子")
else
if request.form(age>=56 and age<=80) then
response.Write("奶奶")
else
if request.form(age>80) then
response.Write("老奶奶")
end if
end if
end if
end if
end if
end if
end if
end if
%>



<form action="" method="post" >
<input name="age" type="text" value="" size="20">请输入内容

<br>
男<input name="sex" type="radio"value="男">
女<input name="sex" type="radio"value="女">
<br>
<input name="" type="submit" value="提交">
</form>
搜索更多相关主题的帖子: form 函数 request 字符 输入 
2008-06-09 18:11
51684444
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-5-26
收藏
得分:0 
多谢二楼的指点。都是网上教程误人子弟。我真该多看看别人代码,我现在才知道IF还能缩进。看来我要学的还多呢
2008-06-10 21:58
快速回复:关于request.form问题(错误:函数需要字符串输入)
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015873 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved