惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - yunshu

(转帖)C/S、B/S及三层结构漫谈 TP-Link 配置(转帖) 如何用VSS VS2005重置按钮代码 asp.net 2.0 网站导航控件 WEB自定义控件小记 VS2005 DataGridView 和 GirdView 横向大比拼 web.config中连接字符串与数据库登陆方式的联系 转帖-win2003各版本的区别 您没有调试该服务器的权限,验证您是服务器“Debugger Users”组的成员 错误:未将对象引用设置到对象的实例 在绑定DataGrid控件,做添加删除时遇到问题(数组越界) visual studio.net已检测到指定的web服务器运行的不是asp.net1.1版。 [WebMethod] 是什么意思? 如何在DataSet中追加记录 怎样添加本地web引用 创建XML文件的两种方法 枚举类型是什么意思,怎么用? 什么是DOM?
request('id')语句,返回的是什么类型的数据
yunshu · 2008-04-20 · via 博客园 - yunshu

问:在做网页数据库时碰到的问题,数据库字段aticleid唯一表示一条记录,点击该记录名称,打开新窗口,地址栏应显示http://***.***.**.**/viewarticle.asp?id=*****
若articleid=0015555,则点击打开后只能显示静态页面部分,地址栏显示http://***.***.**.**/viewarticle.asp?id=84405(随机的)若articleid改成15555,则能正常显示,地址栏显示http://***.***.**.**/viewarticle.asp?id=15555。

答:
ASP中这样的变量一般是Variant类型的,根据你处理情况来定。
这样的话0015555和15555是不能相等的;
对于两个URL
http://***.***.**.**/viewarticle.asp?id=15555
http://***.***.**.**/viewarticle.asp?id=0015555
对于第一个
id1=request('id')=15555(默认类型integer)
对于第二个
id2=request('id')="0015555"(默认类型string)

如果这个id用于sql查询语句,那么
select * from biao where id=id1
即select * from biao where id=15555
select * from biao where id=id2
即select * from biao where id=0015555返回的结果是不同的。
一般来说数据库中的id都是number(integer或者long)类型的,所以用字符串型表示的值查找是不会有任何结果的。后面一个就可能没有任何值返回,所以在显示页面上也就没有动态的显示。

建议你先跟踪检查程序中的sql查询语句,看是否有效;如果是由于上面的错误导致查询出现空集,那么则要修改检查和判断request('id')值的函数
,过滤掉前面的0,或者进行强制类型转换,你看法网络后台程序的时候一定要注意后台数据库的安全,像这样的URL检查(request('id'))是必须的,否则别人就有可能利用这个缺陷构建特殊的URL来使你的后台崩溃。