在客户端验证时显示提示语句_当仅客户端验证对企业有利时

news/2024/7/24 10:09:51 标签: java, php, ssl, https, html
htmledit_views">
html" title=https>https://img-blog.csdnimg.cn/img_convert/323f25b397fa3d0463f80a43acf4a4a6.png" alt="在客户端验证时显示提示语句" width="403px" height="256px" style="outline: none;" />

在客户端验证时显示提示语句

the validation. This is a rule, never to be broken. But here's a funny story how skipping the server-side validation actually helped. 验证。 这是一条规则,永不被打破。 但是,这是一个有趣的故事,跳过服务器端验证实际上有何帮助。

This is a real story, but the actual names have been replaced in XXX, just not to make other people look bad 😀

这是一个真实的故事,但是实际名称已在XXX中替换,只是为了不让其他人看起来很糟😀

There is this site called xxxxxxxxx.com that charges you $XX membership access. Having just moved from Canada, last year I didn't have a US credit card to pay the fee and tried to use my Canadian visa. Problem: the input field for postal code (zip code) accepts 5 characters only, since the zip codes in US a like 90404, 90066 and so on. A Canadian postal code is like H0H-0H0 or H0H0H0, six characters. So seemed like I couldn't pay online. Or could I?

有一个名为xxxxxxxxx.com的网站,向您收取$ XX会员访问费用。 刚从加拿大移居之后,去年我没有美国信用卡来支付这笔费用,并试图使用我的加拿大签证。 问题:邮政编码(邮政编码)的输入字段仅接受5个字符,因为邮政编码在美国类似于90404、900066等。 加拿大邮政编码类似于H0H-0H0或H0H0H0,六个字符。 因此,似乎我无法在线付款。 还是可以吗?

Checking the source code with Firebug gives me this:

使用Firebug检查源代码可以得到以下信息:

html" title=https>https://img-blog.csdnimg.cn/img_convert/4bb0df41a8c0dc1e31d4e4d7c2ee9ec7.png" alt="client.png" style="outline: none;" />

From here it's trivial to change maxlength attribute of the input. Even with IE it's super easy just to type in the address bar something like: html" title=java>javascript:document.getElementsByName('XXXXXXX')[0].maxLength = 100;

从这里更改输入的maxlength属性很简单。 即使使用IE,也很容易在地址栏中输入如下内容: html" title=java>javascript:document.getElementsByName('XXXXXXX')[0].maxLength = 100;

So I did change it, typed my Canadian CC#, Canadian postal code and submitted the form, crossing fingers that the developers who built the site were too pressed by deadlines to do a proper server-side validation. Lo and behold, it worked!

因此,我确实进行了更改,键入了我的加拿大CC#,加拿大邮政编码并提交了表格,但手指交叉地指出,构建该网站的开发人员在截止日期之前过于紧张,无法进行适当的服务器端验证。 瞧,它成功了!

At the end with the help of an innocent client-side tweak I got what I needed (membership), xxxxxxxx.com got more business, and everybody's happy.

最终,在无辜的客户端调整的帮助下,我得到了我所需要的(成员身份),xxxxxxxx.com获得了更多的业务,每个人都很高兴。

There's a lesson in this: sometimes being too strict in data validation for things that don't matter is just in your way. And another: don't assume all your potential clients are from US.

这方面有一个教训:有时候,对无关紧要的数据验证过于严格只是您的方式。 还有一个:不要以为您的所有潜在客户都来自美国。

Tell your friends about this post on Facebook and Twitter

在Facebook和Twitter上告诉您的朋友有关此帖子的信息

翻译自: html" title=https>https://www.html" title=php>phpied.com/when-client-only-validation-is-good-for-business/

在客户端验证时显示提示语句


http://www.niftyadmin.cn/n/1307276.html

相关文章

Oracle版本号的含义

Oracle版本号的含义 Oracle产品版本号由5部分数字组成 1、主发布版本号:是版本的最重要的标识号,表示重大的改进和新的特征 2、主发布维护号:维护版本号,一些新的特性的增加和改进 3、应用服务器版本号:Oracle应用服…

现在可用:Stoyan Stefanov在Amazon.com上发布的“面向对象JavaScript”

I got a nice email from Amazon last week 🙂 Unfortunately the book is still missing things like cover image and description, but its a progress! 上周我从亚马逊收到了一封不错的电子邮件🙂不幸的是,这本书仍然缺少诸如封面图像和描…

Matlab基本函数-ginput函数

1、ginput函数:获取指定点坐标值 2、用法说明 (1)[x,y] ginput(n) 函数从当前的坐标图上选择n个点,并返回这n个点的相应的坐标向量x、y。n个点可由鼠标定位。用户可以按下回车键在输入n个点之前终止输入; &#xf…

ffmpeg重采样命令_在命令行上制作专辑采样器视频

ffmpeg重采样命令Heres a video I made to raise awareness about Anaconda Limousines first album (where I play guitar and co-wrote 1 song): https://www.youtube.com/watch?v0LavyKbSuvI. This is a post that explains how it was made so if anyone wants to made a …

ie mhtml_MHTML –需要数据时:IE7及以下版本中的URI

ie mhtmlUPDATE: Its very important to have a closing separator in the MHTML document, otherwise there are known issues in IE7 on Vista or Windows 7. The details are here. 更新:在MHTML文档中有一个分隔符非常重要,否则在Vista或Windows 7的…

100句十分精辟的人生格言

100句十分精辟的人生格言 1、生活是一面镜子。你对它笑,它就对你笑;你对它哭,它也对你哭。 2、活着一天,就是有福气,就该珍惜。当我哭泣我没有鞋子穿的时候,我发现有人却没有脚。 3、人生是个圆&#xff0c…

100句富有哲理的人生格言

100句富有哲理的人生格言 1、人之所以有一张嘴,而有两只耳朵,原因是听的要比说的多一倍。 2、哲人无忧,智者常乐。并不是因为所爱的一切他都拥有了,而是所拥有的一切他都爱。 3、泪水和汗水的化学成分相似,但前者只能为…

SSH2三大框架整合出错(一)

usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2013-12-1 22:01:15 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.27 using APR versi…