Blogger Information
Blog 21
fans 0
comment 0
visits 21057
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
js和php之urlencode
星辰大海
Original
1606 people have browsed it

开发中,遇到JS和PHP对于urlencode的差异化,导致的前后端不统一。

场景:两端拼接请求参数并md5后比较验证,保证接口安全性。

经查明,主要是特殊符号搞的鬼。

!*()' 仅后端编码

-_.~ 前后端都不编码

@#¥%^&=+:;"\/?<>[]{}`  前后端都编码


%  前端decode会报错

+  后端urldecode会转换成空格


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post