只需要注册个企业微信就可以用 不需要公网IP固定IP有网就行
https://work.weixin.qq.com/
http://192.168.3.63:998/index.php?num=777&passwd=123&title=%40%40TEXT%40%40
<?php
$num = $_GET['num'];
$passwd = $_GET['passwd'];
$content = $_GET['title'];
$msg = $_GET['description'];
$url = $_GET['null.com'];
function curlPost($url,$data=""){
$ch = curl_init();
$opt = array(
CURLOPT_URL => $url,
CURLOPT_HEADER => 0,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $data,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_TIMEOUT => 20
);
$ssl = substr($url,0,8) == "https://" ? TRUE : FALSE;
if ($ssl){
$opt[CURLOPT_SSL_VERIFYHOST] = 1;
$opt[CURLOPT_SSL_VERIFYPEER] = FALSE;
}
curl_setopt_array($ch,$opt);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
$corpid="11111"; //企业id
$corpsecret="11111"; //企业secret
$Url="http://wxts.geekxw.top/cgi-bin/gettoken?corpid=$corpid&corpsecret=$corpsecret";
$res = curlPost($Url);
$ACCESS_TOKEN=json_decode($res)->access_token;
$Url="http://wxts.geekxw.top/cgi-bin/message/send?access_token=$ACCESS_TOKEN";
$data="{\"touser\":\"@all\",\"msgtype\":\"text\",\"agentid\":1000004,\"text\":{\"content\":\"$content\n$msg$url\"},\"safe\":0}"; //此处ID需要修改,1000004修改为自己应用id
$res = curlPost($Url,$data);
$errmsg=json_decode($res)->errmsg;
if($errmsg==="ok"){
echo "发送成功
by:小陈折腾日记!
B站:https://space.bilibili.com/22447499";
}else{
echo "by:小陈折腾日记!
B站:https://space.bilibili.com/22447499
发送失败,".$errmsg;
}
?>
效果如图
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
- 最新
- 最热
只看作者