本站即日起正式部署SSL证书启用https安全连接, 联系站长:416326801#qq.com(#改成@)

emlog设置https后边栏日期不能显示

标签: PHP

修改/include/lib/function.base.php


/**
 * 获取站点地址(仅限根目录脚本使用,目前仅用于首页ajax请求)
 */
function getBlogUrl() {
	$phpself = isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : '';
        // 增加https端口判断
        $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
	if (preg_match("/^.*\//", $phpself, $matches)) {
		return $protocol . $_SERVER['HTTP_HOST'] . $matches[0];
		// return 'http://' . $_SERVER['HTTP_HOST'] . $matches[0];
	} else {
		return BLOG_URL;
	}
}


Apache部署SSL证书配置https

标签: Apache

<VirtualHost *:443>
    DocumentRoot "/var/www/html"
    ServerName jishu8.net
    SSLEngine on
    SSLCertificateFile /usr/local/apache/conf/2_jishu8.net_cert.crt
    SSLCertificateKeyFile /usr/local/apache/conf/3_jishu8.net.key
    SSLCertificateChainFile /usr/local/apache/conf/1_root_bundle.crt
</VirtualHost>

PHP导出Excel文件

标签: PHP Excel

<?php  
//输出的文件类型为excel  
header("Content-type:application/vnd.ms-excel");  
//提示下载  
header("Content-Disposition:attachement;filename=jishu8_".date("Ymd").".xls");  
//报表数据  
$ReportArr = array(array(1,2,3,4,5),  
                    array('A','B','C','D','E'),  
                    array('up','down','left','right','center'),  
                    array('欢','迎','光','临','技','术','吧','!')  
                );  
$ReportContent = '';  
$num1 = count($ReportArr);  
for($i=0;$i<$num1;$i++){  
    $num2 = count($ReportArr[$i]);  
    for($j=0;$j<$num2;$j++){  
        //ecxel都是一格一格的,用\t将每一行的数据连接起来  
        $ReportContent .= '"'.$ReportArr[$i][$j].'"'."\t";  
    }  
    //最后连接\n 表示换行  
    $ReportContent .= "\n";  
}  
//用的utf-8 最后转换一个编码为gb  
$ReportContent = mb_convert_encoding($ReportContent,"gb2312","utf-8");  
//输出即提示下载  
echo $ReportContent;  
?>  
1 2 3 4 5 6 ... Next »... Last »