网站开发
pbootcms调用指定栏目名称及超链接方法
2022-04-18
{pboot:sort scode=12}<p> <span>[sort:name]</span> <a href="[sort:link]">+更多</a> </p>{/pboot:sort}
pbootcms 默认后台地址
2022-03-27
pbootcms 下载的时候,默认是带了sql lite数据库,直接放在php环境下就可以运行了,并不需要安装。这就造成了许多新手朋友不知道怎么怎么网站后台!
系统后台默认访问路径:http://域名/admin.php 账号:admin 密码:123456
PbootCMS伪静态问题 Apache伪静态出现页面无法正常
2022-03-27
首先我们来看一下PbootCMS官方提供的伪静态规则:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#如果页面出现"No input file specified." 请注释第一条,启用第二条
RewriteRule ^(.*)$ i
PbootCMS运行环境介绍
2022-03-27
1、PHP版本要求:
PHP5.4+,支持最新的PHP7.0、7.1、7.2
2、需要开启的PHP扩展有:
extension=php_curl.dll //远程访问地址需要
extension=php_gd2.dll //图片处理
extension=php_mbstring.dll //字符串处理
extension=php_mysqli.dll //mysql连接
extension=php_open
php处理setcookie实例
2022-03-27
1、浏览器开启cookie。
2、删除在setcookie()之前的任何HTTP头部输出。
3、使用php的setcookie()来创建cookie即可。
使用php的setcookie()来创建cookie和php中开启session的 session_start()一样,在setcookie()之前不能有任何HTTP头部输出。我去检查代码,发现如下代码
var_dum
php开发时常犯的一些错误
2022-03-27
deprecated是最低级别的错误,表示“不推荐,不建议”。比如PHP5中使用的ereg系列的正则匹配函数就会报此类错误。这种错误一般由于使用不推荐的、过时的函数或语法造成的。其虽不影响PHP正常流程,但一般情况下建议修正。
其次是notice。这种错误一般是语法中存在不当的地方。如使用变量但是未定义就会报此错。
php怎么将图片保存到本地
2022-03-27
function getImage($url,$save_dir='',$filename='',$type=1){
if(trim($url)==''){
return array('file_name'=>'','save_path'=>'','error'=>1);
}
if(trim($save_dir)==''){
$save_dir='./';
}
if(trim($filename)==''){//保存文件名
$ext = strrchr($url,'.');
if($ext!='.gif'&am
php里怎么获取文本中首张图片地址
2022-03-27
function getFirstPic($content){
if(preg_match_all("/(src)=([\"|']?)([^ \"'>]+\.(gif|jpg|jpeg|bmp|png))\\2/i", $content, $matches)){
$str=$matches[3][0];
if(preg_match('/\/ueditor\/php\/upload\/image/',$str)){
return $str1=substr($str,6);
}
}
}
PHPExcel 读取exce方法
2022-03-27
function readExcel($filename, $encode = 'utf-8')
{
// import("ORG.Util.PHPExcel.IOFactory");
import("Org/Util/PHPExcel");
if (strpos($filename, "xlsx")) {
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
} else {
$objReader = PHPExcel_IOFactory::createReader('Excel5'
帝国CMS截取标题后面显示省略号
2021-12-09
列表页加法
$listtemp='<li>
<a href="[!--titleurl--]">
'.esub($r[title],40,'…').'
<span class="time_more">[!--newstime--]</span>
</a>
</li>';
不加是这样
'.esub($r[title],40).'
加后是
'.esub($r[title],40,'…').'
首页等调用灵动标题加法
<
帝国cms伪静态规则之nginx主机版
2021-11-19
nginx主机上使用的帝国cms伪静态规则,如果是使用的宝塔面板,直接添加到站点伪静态规则中。
# nginx configuration by fm0898.com
location /tags {
rewrite ^/tags/(.*)/$ /e/tags/index.php?tagid=$1;
rewrite ^/tags/(.*)/(.*).html$ /e/tags/index.php?tagid=$1&page=$2;
}
location /list {
rewrit
帝国cms伪静态规则之apache主机版
2021-11-19
这是阿帕奇主机上使用的帝国cms伪静态规则
RewriteEngine On
RewriteBase /
RewriteRule ^tags/(.*)/$ /e/tags/index.php?tagid=$1
RewriteRule ^tags/(.*)/(.*).html$ /e/tags/index.php?tagid=$1&page=$2
RewriteRule ^list/([0-9]+)-([0-9]+)-([0-9]+)-(.*)-([0-9]+).html$ /e/action/ListInfo.php?ph=1&