首页> 实战笔录 >PHP开发笔记 >PHP PHP
php自定义函数过滤数字防SQL注入
作者:小萝卜 2019-03-27 【 PHP 自定义函数 】 浏览 2180
简介php自定义函数过滤,数字防SQL注入,整型注入,Int类型注入
php自定义函数过滤数字防SQL注入
代码如下:
代码如下:
//防整型注入 function get_int($str){ $str=floor(floatval($str)); if (!is_numeric($str)){ header("location:".$_SERVER['HTTP_REFERER'].""); exit; } return $str; } var_dump(get_int($_GET['id']));
很赞哦! (0)
下一篇:php自定义函数获取项目目录
相关文章
- php自定函数,会员还有多久到期,活动还有多久到期
- php实现删除该目录以及该目录下面的所有文件和子文件夹
- php在高并发时使用redis锁限制并发访问
- windows环境PHP 如何安装ionCube扩展
- PHP获取指定月份的日期
- PHP防恶意灌水,php防留言板恶意灌水
- php 判断身份证号是否正确
- 在php中将特大数字转成带有千/万/亿为单位的字符串
- Namespace declaration statement has to be the very first statement or after any declare call in the
- _initialize 和 __construct中不能return