I want to control my log printing but also it will make the parameter replaced with *symbol, if I execute a url which not including security parameter such as:
http://localhost/meeting/op.do, access.log must record it, but if I input a url which incuding security parameter such as
http://localhost/meeting/import.php?cmd=admin&password=pass&userName=hsh&meetingID=123, then the regular expression replacement must work and it will sove:
http://localhost/meeting/import.php?cmd=****&password=****&userName=****&meetingID=****, into logs,What should I go to achieve? remind:My develop environment is W7.thanks!
http://localhost/meeting/op.do, access.log must record it, but if I input a url which incuding security parameter such as
http://localhost/meeting/import.php?cmd=admin&password=pass&userName=hsh&meetingID=123, then the regular expression replacement must work and it will sove:
http://localhost/meeting/import.php?cmd=****&password=****&userName=****&meetingID=****, into logs,What should I go to achieve? remind:My develop environment is W7.thanks!
解决方案 »
- php能调用.net web service不?
- 两种方式生成视频截图(共享给有需要的人)
- 内容分开采集成功,但通过一级页面的结果,传入到二级页面采集怎么处理
- [源码]天骄天下个人网站系统(三个月倾情打造)
- 怎样上传一个csv文件更新数据库?
- 好久不见~继续为大家推荐全新架构的PHP论坛系统~YouYaX_V8.0
- 彩票走势图用php如何写,可付钱或合作
- 这个json格式没错啊,但是回调函数不能执行
- PHP怎麼实现分页显示功能 网络上下载了很多分页显示
- 跪求大礼相助:dedetag.class.php 20行报错 导致后台登录界面右侧的框架index_body.php不显示
- 求助~ thinkphp url和路径导致的Apache错误
- 图片防盗链
正则查找,这个security parameter
若cmd或password等任一个可做参考
只要查有无所参数就行了或是
if(isset($_GET['cmd']){$bFlag=true;}//等等
以上识别后,若为无安全参数,直接存在log里,若有,把url再来个
$str = 'http://localhost/meeting/import.php?cmd=admin&password=pass&userName=hsh&meetingID=123,';
$patten="/=(\w+)[&|,]/iUs";
$replacement = "****";
print preg_replace($patten,$replacement,$str);
再存log