您的位置:程序门 -> vb -> 网络编程



asp传值问题


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


asp传值问题
发表于:2008-01-06 13:26:38 楼主
uppics.asp  
<%  
dim   id  
id=request("id")  
document.form1.file.value=id'文本域可以给他它一值吗,我有另一张页面通过判断value有没有值,来判断是否上传图片了  
if   document.form1.file.value=""   then  
response.write(" <script> alert('还没上传图片') </script> ")  
else  
response.write(" <script> alert('已上传图片') </script> ")  
end   if  
%>  
<html>  
<head> <title> test </title> </head>  
<body>  
<form   id="form1"   name="form1"   enctype="multipart/form-data"   method="post"   action="check.asp">  
<label> </label>  
<label>  
<input   type="file"   name="file"   />  
</label>  
<input   type="submit"   name="submit"   value="提交"   />  
</form>  
</body>  
</html>  
--------------------  
check.asp  
<html>  
<head>  
<title> </title>  
</head>  
<body>  
<script>  
alert('check完毕');window.location='uppics.asp?id=1'  
</script>  
</body>  
</html>  
---------------  
我想实现的是:在uppics上传图片点提示时,转到check.asp去核实(我省略了check的代码),核实正确后加了一个id=1传给uppics.asp,uppics.asp把获取到的id传给file.value,然后再判断file.value的值是不是为空,如果不为空了,就提示已上传了图片。  
------希望有人帮我解决问题,先谢谢各位来回答的人—————  
问题补充:这个程序是错的,了解的人帮忙修改一下,或是有更好的办法,只要能实现此功能就可以。
发表于:2008-01-06 13:54:411楼 得分:0
html code
<%@language="vbscript"%> <html> <head> <title> test </title> </head> <body> <form id="form1" name="form1" enctype="multipart/form-data" method="post" action="check.asp"> <label> </label> <label> <input type="file" name="file" /> </label> <input type="submit" name="submit" value="提交" /> </form> <% dim id id=request("id") 'document.form1.file.value=id'文本域可以给他它一值吗,我有另一张页面通过判断value有没有值,来判断是否上传图片了 'if document.form1.file.value="" then if id<>"1" then response.write(" <script> alert('还没上传图片') </script> ") else response.write(" <script> alert('已上传图片') </script> ") end if %> </body> </html>


check.asp中
html code
<%@language="vbscript"%> <% response.redirect "uppics.asp?id=1" %>
发表于:2008-01-06 21:58:402楼 得分:0
谢谢一楼的回答,这样确实可以成功运行,但这样就有一个功能没办法实现,也就是'document.form1.file.value=id'这句,我是想在收到id以后并给file.value赋值,因为我有另一张页面在对file.value进行check是否为空,如果为空证明还没上传图片。能帮我看看嘛,谢谢!
发表于:2008-01-07 09:46:353楼 得分:0
html code
<%@language="vbscript"%> <html> <head> <title> test </title> </head> <body> <form id="form1" name="form1" enctype="multipart/form-data" method="post" action="check.asp"> <label> </label> <label> <% dim id id=request("id") 'document.form1.file.value=id'文本域可以给他它一值吗,我有另一张页面通过判断value有没有值,来判断是否上传图片了 'if document.form1.file.value="" then if id<>"1" then response.write("<input type="file" name="file" value=0 />") response.write(" <script> alert('还没上传图片') </script> ") else response.write("<input type="file" name="file" value=1 />") response.write(" <script> alert('已上传图片') </script> ") end if %> </label> <input type="submit" name="submit" value="提交" /> </form> </body> </html>


快速检索

最新资讯
热门点击