php include文件后多出一空白行
用多种编辑软件修改过的php网站可能会遇到一很怪问题:用include引入的footer和header文件都在上面多出一空白行,直接把被引入的文件放入则没问题。这个问题极有可能是编码问题引起的。如果采用utf-8编码要设置为无bom,并且要所有的涉及到的页面包括css及其他文件都要以无bom的utf-8编码。具体方法可以是:在Dreamweaver里 点“修改”,选择“页面属性”,“标题/编码”,把 包括unicode签名(bom) 的勾取消。
相关文档:
<?php
$mydbhost ="localhost"; //配置主机
$mydbuser ="root"; //数据库用户
$mydbpw ="8312836"; //数据库密码
$mydbname ="jingyun"; //数据库名
//$mydbcharset ="GBK";
$conn=mysql_connect($mydbhost,$mydbuser,$mydbpw) or die ("服务器连接错误".mysql_error());
mysql_select_db($myd ......
<?
@session_start();
$counter = intval(file_get_contents("counter.dat"));
if(!$_SESSION['jingyun'])
{
$_SESSION['jingyun'] = true;
$counter++;
$fp = fopen("counter.dat","w");
fwrite($fp, $counter);
fclose($fp);
}
?>
总访问 <span style="font-size:14px; color:#FF6600" mce_sty ......
/*php 防注入函数
string $feifa 限制元素组成
如有非法字符跳转到上一页 返回 0 没有返回 1
*/
//使用方法
//$feifa=array("select","delete","from","update","create","destory","drop","alter" ......
本文适合CentOS。一步一步来,不要错。
先下载工具ssh shell,个人感觉这个比较好用,推荐给大家
http://docs.isvps.net/soft/SSHSecureShellClient-3.2.9.zip
然后是一些必要的软件包
nginx源码包: http://www.nginx.org/download/nginx-0.7.65.tar.gz
php源码包: http://cn.php.net/distributions/php-5.2.11.tar.gz ......
$str=preg_replace("/\s+/", " ", $str); //过滤多余回车
$str=preg_replace("/<[ ]+/si","<",$str); //过滤<__("<"号后面带空格)
$str=preg_replace("/<\!--.*?-->/si","",$str); //注释
$str=preg_replace("/<(\!.*?)>/si","",$s ......