Home > Backend Development > PHP Tutorial > 请教PHP限制字符输入如何写

请教PHP限制字符输入如何写

WBOY
Release: 2016-06-13 11:56:29
Original
1486 people have browsed it

请问PHP限制字符输入怎么写?

本帖最后由 langlang66 于 2014-04-15 10:57:58 编辑
	public static function ds($bet){<br />		return count(explode('|', $bet));<br />	}
Copy after login

以上我的PHP代码,现在出现了注入漏洞,使用以下代码可以从网页上提交
<script type="text/javascript"> <br />var game={<br />type:"1",<br />played:"10",<br />groupId:2},<br />user="langlang",<br />aflag=false;<br /></script>
Copy after login

我想限制使用代码提交,请问怎么写?
------解决方案--------------------
它是怎么从网页提交的?
------解决方案--------------------
 正则— —! 过滤掉预定意的危险字符
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template