PHP
Quincy379
坚持、冷静
展开
-
使用QQ邮箱发送邮件,QQ邮箱的smtp设置
步骤一:步骤二:步骤三:特别说明:这个授权码就是所谓的请#填写SMTP服务器邮箱密码#步骤四:步骤五:校验配置是否正确!!!!https://www.cnblogs.com/kimsbo/p/10671851.html...原创 2019-10-13 14:14:12 · 3138 阅读 · 0 评论 -
WordPress隐藏后台位置
最近搞了下wp,感觉真的太棒了。但是有个问题我一直在考虑,怎么隐藏后台位置,因为开源如果不隐藏感觉会很危险,毕竟黑客很黑的,所以搜了下解决方案:打开wordpress根目录wp-login.php在文件的最后加入如下代码://隐藏后台位置 if($_GET["web"]!="abc"){ header('Location: http://pblog.rzepx.cn/'...原创 2019-10-13 12:55:31 · 972 阅读 · 0 评论 -
Warning: touch() [function.touch]: Utime failed: Permission denied in /home/wordpress/wp-content/the
原因:对应文件所在文件夹的权限不够,需要赋权0777处理:创建缓存的cache文件没有权限,我就直接将cache的权限设为0777,但是还是不行,还是提示权限不足,进入cache目录后还有一个index.html文件,将其设为0777,问题就解决了http://www.zuimoban.com/php/php/4319.html...原创 2019-10-12 20:06:47 · 1104 阅读 · 0 评论 -
PHP之标准注释
格式化一下别人的PHP代码居然注释错乱了,正确的姿势原来在这:程序代码注释注释的原则是将问题解释清楚,并不是越多越好。若干语句作为一个逻辑代码块,这个块的注释可以使用/* */方式。具体到某一个语句的注释,可以使用行尾注释://。/* 生成配置文件、数据文件。*/ $this->setConfig(); $this->createConfig...原创 2019-05-24 08:01:08 · 254 阅读 · 0 评论 -
PHP之写数组数据到Log文件中
一句就够,非常完美!cpError::write(print_r($data, 1));原创 2019-06-14 21:20:06 · 1674 阅读 · 0 评论 -
PHP之今日无题
Bug is a bitch!disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_soc...原创 2019-06-16 09:59:06 · 187 阅读 · 0 评论 -
PHP之今日无题
<?phpif (strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger') !== false) { header("Content-type: text/html; charset=utf-8"); print <<<EOT<!DOCTYPE html><html lang=...原创 2019-07-02 13:07:51 · 151 阅读 · 0 评论 -
PHP之content-type记录(一)
利用header下载文件$filename = rtrim($_SERVER['DOCUMENT_ROOT'],'/').'/app/files/payment_status.csv'; header('Content-Disposition: attachment; filename=payment_status.xlsx'); header('Content-Type: appl...原创 2019-07-15 14:01:34 · 1255 阅读 · 0 评论 -
PHP之post请求
$url = 'http://www.dnzke.com/pay/gateway/'; $postdata = http_build_query($params); $options = array( 'http' => array( 'method' => 'POST', ...原创 2019-07-15 15:24:34 · 364 阅读 · 0 评论 -
PHP之更改数组键名
源码二次开发需要: $result['status'] = $result['code']; unset($result['code']);PHP新手干啥都累,什么都要查!https://blog.csdn.net/weishuxiao1/article/details/36188257...原创 2019-07-16 09:38:18 · 4054 阅读 · 0 评论 -
PHP之json_encode使用
主要是第二个参数1.第二个参数为空:$result = json_encode($result);//{"msg":"\u7b7e\u540d\u9519\u8bef\uff01","time":1563241332,"data":[],"status":105}2.添加第二个参数:$result = json_encode($result,JSON_UNESCAPED_UNICODE...原创 2019-07-16 09:49:50 · 695 阅读 · 0 评论 -
PHP之 json_encode() 空数组返回[]与{}
PHP菜鸡,前端解析的时候纠结了好久:$result = array( "arr1" => (object)array(), "arr2" => array() ); echo json_encode($result );// {"arr1":{}, "arr2":[]}或者json_encode($result ,JSON_FORCE_OBJECT)得到的是...原创 2019-07-17 10:11:10 · 739 阅读 · 0 评论 -
PHP提权大马一枚
<?php@error_reporting(E_ERROR);@ini_set('display_errors', 'Off');@ini_set('max_execution_time', 10000);header("content-Type: text/html; charset=gb2312");function strdir($str) { return str_rep...原创 2019-07-31 17:17:00 · 10805 阅读 · 3 评论 -
PHP之array_walk()
刚开始一脸懵逼,查了下才知道可以这么玩,像极了反射?用法:array_walk(array,myfunction,parameter…)array 必需。规定数组。myfunction 必需。用户自定义函数的名称。类型字符串$global_version = array_walk /*Version*/ ( /*This is a necessa...原创 2019-07-31 17:44:53 · 342 阅读 · 0 评论 -
PHP大马加密
<?php /** * Be sure to include no trailing slash on the path. * See http://www.php.net/support.php for more information * about PHP manuals and their types. */ $password = "2aefc34200a29...原创 2019-07-31 18:12:31 · 19093 阅读 · 2 评论 -
PHP之抖音无水印解析源码
<?phpheader("Content-Type:text/json;charset=utf-8");error_reporting(0);$url = @$_GET['url'];//抖音视频地址$isFormat = @$_GET['isFormat'];//是否格式化数据,默认true$old = @$_GET['old'];//是否使用旧版数据格式,默认falsecl...原创 2019-08-31 15:33:22 · 2323 阅读 · 0 评论 -
屏蔽PHP错误
<?php//禁用错误报告error_reporting(0); //报告运行时错误error_reporting(E_ERROR | E_WARNING | E_PARSE); //报告所有错误error_reporting(E_ALL); error_reporting(7);/*设置php错误检测级别E_ERROR - 致命性运行时错 (1)E_WA...原创 2019-05-12 14:57:03 · 1872 阅读 · 0 评论 -
PHP之 json_encode 和 json_decode
json_decode语法:json_decode ($json [,$assoc = false [, $depth = 512 [, $options = 0 ]]])$json 为待解码的数据,必须为utf8编码的数据;$assoc 值为TRUE时返回数组,FALSE时返回对象;(调用返回数据的值时会不一样)$depth 为递归深度;$option 二进制掩码,目前只支持 J...原创 2019-05-25 14:55:57 · 155 阅读 · 0 评论 -
Uncaught Error: Call to undefined function mysql_select_db()
https://stackoverflow.com/questions/40650747/uncaught-error-call-to-undefined-function-mysql-select-db&lt;?php $username="root"; $password="namungoona"; $hostname = "localhost"; //conne原创 2019-02-01 19:28:06 · 21435 阅读 · 1 评论 -
ERROR 1406 (22001): Data too long for column 'c_name' at row 1&&ERROR 1366 (HY000): Incorrect string
问题描述:mysql&gt; use flyingcat;Database changedmysql&gt; source E:\wamp64\www\flyingcat\install\data.sqlQuery OK, 0 rows affected (0.00 sec)Query OK, 0 rows affected (0.01 sec)Query OK, 0 rows...原创 2019-02-02 16:13:52 · 3019 阅读 · 5 评论 -
phpmyadmin的初始账号、密码
初始账号是root,密码为空原创 2019-01-30 09:27:14 · 18216 阅读 · 0 评论 -
phpstorm多个目录中的文件查找替换内容怎么做?
有用,还是搜了一会的:https://segmentfault.com/q/1010000008913082/a-1020000008913387原创 2019-02-22 11:46:51 · 4484 阅读 · 0 评论 -
MySQL之Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in...
解决:在$data = mysqli_query($dbc, $query);后加上这样一段代码:$result = mysqli_query($this->conn, $this->sql);if (!$result) { printf("Error: %s\n", mysqli_error($this->conn)); //exit();参考文章:...原创 2019-02-17 12:00:40 · 15728 阅读 · 0 评论 -
PHP项目部署的正确姿势
参考链接:https://www.cnblogs.com/cyun/p/4146131.htmlhttps://blog.csdn.net/weixin_39666151/article/details/81167177不再赘述!原创 2019-03-06 20:11:07 · 3589 阅读 · 0 评论 -
Nginx 提示500 ,PHP设置提示具体错误
error_reporting(E_ALL);ini_set('display_errors', 'On');参考链接:https://blog.csdn.net/joeson7456/article/details/77916175原创 2019-03-19 17:24:39 · 2216 阅读 · 0 评论 -
解决新版wampserver 2/3个服务器正在运行 问题
有个服务需要手动起来,看下链接地址的第一个图:https://blog.csdn.net/firstblog/article/details/79529719原创 2019-03-17 09:47:42 · 6890 阅读 · 0 评论 -
LNMP - Warning: require(): open_basedir restriction in effect错误解决方法
之前遇到过,没记。又碰到了,下面这个哥们写的比较全,报错截图一模一样:https://blog.csdn.net/watermelonmk/article/details/80967658原创 2019-04-26 14:55:29 · 5784 阅读 · 0 评论 -
别人的域名绑定了你的服务器IP处理方案(PHP处理)
调试的时候有人绑定了我的服务器IP,调试完毕他居然还没换掉。我有点无语,所以想了下处理方法,在你程序的入口文件里加入下列代码,这种方式处理比较简单:<?phpif($_SERVER['SERVER_NAME']=='别人的域名.com'){ header("Location: https://www.baidu.com"); //或者干点你想干的事情,比如让它跳到羞羞的网站上...原创 2019-04-26 14:54:20 · 889 阅读 · 0 评论 -
PHP中$this、self的理解附带范围解析操作符::(摘自官网)
In PHP, you use the self keyword to access static properties and methods.The problem is that you can replace $this->method() with self::method() anywhere, regardless if method() is declared stati...原创 2019-04-26 14:55:50 · 1146 阅读 · 0 评论 -
lamp禁止IP直接访问服务器
配置如下:NameVirtualHost IP地址<virtualhost IP地址:80> ServerName IP地址 <Directory /> Order Allow,Deny Deny from all </Directory></virtualhost><Vi...原创 2019-04-28 13:58:01 · 434 阅读 · 0 评论 -
PHP Fatal error: require(): Failed opening required
使用的是lnmp解决方法/usr/local/nginx/confvim fastcgi.confhttps://www.cnblogs.com/300js/p/9224567.html原创 2019-05-03 16:32:10 · 10109 阅读 · 1 评论 -
php之unset用法
unset() — 释放给定的变量。void unset ( mixed $var [, mixed $... ] )unset() 销毁指定的变量。unset() 在函数中的行为会依赖于想要销毁的变量的类型而有所不同。如果在函数中 unset() 一个全局变量,则只是局部变量被销毁,而在调用环境中的变量将保持调用 unset() 之前一样的值。<?phpfunc...原创 2019-05-20 15:43:09 · 1065 阅读 · 0 评论 -
PHP连接mysql数据库报错:Call to undefined function mysql_connect()
我用的PHP Version:7.2.14https://blog.csdn.net/zhoucheng05_13/article/details/75082722原创 2019-02-01 19:15:40 · 1363 阅读 · 0 评论