源代码打开除了add.php之外,全部是空白页面。
config.php中的代码: <?php header("Content-type: text/html; charset=utf-8"); define('HOST', '127.0.0.1'); define('USERNAME', 'root'); define('PASSWORD', ''); ?> connect.php中的代码: <?php require_once('config.php'); //Á¬¿â if(!($con = mysql_connect(HOST, USERNAME, PASSWORD))){ echo mysql_error(); } //Ñ¡¿â if(!mysql_select_db('info')){ echo mysql_error(); } //×Ö·û¼¯ if(!mysql_query('set names utf8')){ echo mysql_error(); } ?>
我猜是配置文件出错了,凡是没有导入配置文件的页面都能显示。
本人os x系统,mamp集成环境。