php IP黑名单

php IP黑名单

<?php //禁用ip地址 ===================================== $ip=getIP() ; //echo 'IP:'.$ip.'<br/>'; $file_path = "ip.txt"; if(file_exists($file_path)){ $file_arr = file($file_path); for($i=0;$i<count($file_arr);$i++){//逐行读取文件内容 //echo $file_arr[$i]."=<br />"; if...

PHP 2021-09-07 AM 1590℃ 0条
禁止 <script> 缓存

禁止 <script> 缓存

禁止 缓存<script type="text/javascript"> document.write("<script src='/echarts/echarts.min.js?"+Math.random()+"'><\/script>"); </script>

前端 2021-09-06 PM 1531℃ 0条
php 检查该数组有重复值

php 检查该数组有重复值

php 检查该数组有重复值if (count($array) != count(array_unique($array))){ echo '该数组有重复值'; }

PHP 2021-09-06 PM 1457℃ 0条
php实现IP地址和数字相互转换

php实现IP地址和数字相互转换

echo $a=ip2long ("202.97.224.68");//地址转换成数字 系统自带的函数注:这里面有一个要注意的地方,大概由于PHP无法正确判断转换完的数字类型,出现负数的情况。这时候只要把原来IP对应的字段int转换成bigint即可echo 'trueip:'.long2ip('3793747831');//数字转换成IP地址 系统自带的函数

PHP 2021-09-06 PM 1311℃ 0条
requests方式给FLASK 服务器传送图片 pc版本和 micropython 版本

requests方式给FLASK 服务器传送图片 pc版本和 micropython 版本

这几天都在折腾图片这个事,受制于单片机的不稳定性很简单的图片经常花花绿绿的。。。 考虑到自己写传输需要分段还要写校验协议,不但麻烦而且速度慢还浪费数据流量,不如直接用别人的成品库,由于自己有个自用服务器于是直接用request库传送图片。首先是PC端对PC端的收发这是电脑给服务器发送图片的发送端写法import requests import binascii #二进制转字符串一下 url = 'http://192.168.3.190:5000/updata' with open('5.jpg','rb') as f: img=f.read() img=binascii.b2a...

MicroPython 2021-09-03 PM 967℃ 0条
php搜索引擎蜘蛛爬取记录源码

php搜索引擎蜘蛛爬取记录源码

如果是搜索引擎的蜘蛛就记录到spider文本:当前URL + IP<?php $useragent = addslashes(strtolower($_SERVER['HTTP_USER_AGENT'])); if (strpos($useragent, 'googlebot')!== false){$bot = 'Google';} elseif (strpos($useragent,'mediapartners-google') !== false){$bot = 'Google Adsense';} elseif (strpos($useragent,'baidusp...

PHP 2021-09-03 PM 1589℃ 0条
MySQL常用查询语句

MySQL常用查询语句

查询所有数据select * from 表名查指定列select 字段1,字段2 from 表名根据用户名密码查询数据对比;多条件 并关系 查询;两个条件都成立select 字段1,字段2 from 表名 where 字段1='admin' and 字段2='password'多条件 或关系 查询;两个条件成立一个即可select 字段1,字段2 from 表名 where 字段1='admin' or 字段2='password'字段总条数select count(*) from 表名精确查找select * from 表名 where id=1查询某字段总和select sum(...

数据库 2021-09-03 PM 1532℃ 0条
JS生成二维码-Jquery生成二维码-QRCODE.JS

JS生成二维码-Jquery生成二维码-QRCODE.JS

JQUERY生成二维码:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Jquery生成二维码</title> <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src=&...

前端 2021-09-03 PM 1543℃ 0条
PHP获取网址301重定向跳转后的网址

PHP获取网址301重定向跳转后的网址

PHP获取网址301重定向跳转后的网址源码:function get301URL($url){ $header = get_headers($url,1); if (strpos($header[0],'301') || strpos($header[0],'302')) { if(is_array($header['Location'])) { return $header['Location'][count($header['Location'])-1]; }else{ return $h...

前端 2021-09-03 PM 1510℃ 0条
URL网址16进制加密源码

URL网址16进制加密源码

URL网址16进制加密源码:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>URL网址16进制加密工具</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;}</style></head>...

前端 2021-09-03 PM 1789℃ 0条
JS原生加密解密encodeURI/decodeURI

JS原生加密解密encodeURI/decodeURI

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>JS加解密</title><style>body{ margin:0; text-align:center}textarea{ margin:0; width:60%; height:200px;} </style></head><body> <p...

前端 2021-09-03 PM 1543℃ 0条