PHP和MYSQL连接时出现以下问题,不知道如何处理,请高手指点

来源:百度知道 编辑:UC知道 时间:2024/04/30 15:01:51
刚装好APACHE+PHP+MYSQL时能用,过了一天再用时就出现以下问题:
Warning: file_get_contents(lang.tmp) [function.file-get-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\xampp\index.php on line 2

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\xampp\index.php:2) in C:\xampp\htdocs\xampp\index.php on line 4
index.php的部分代码如下:
<?
if(file_get_contents("lang.tmp")=="")
{
header("Location: splash.php");
exit();
}
?>

楼上的不对,第一个警告信息的意思是:找不到文件(看看你的lang.tmp文件的路径对不对);第二个警告信息的意思是:在调用header之前已经有输出了。其实这个输出就是你的第一个警告信息。说白了就是:其实只有一个错误,就是找不到lang.tmp文件。用绝对路径试试。

首页有问题啊..好象~~首页代码贴出来看看呢~
--------
改成这样试试
<?
if(file_get_contents("lang.tmp")==false)
{
header("Location: splash.php");
exit();
}
?>

楼上说的对,另外解决Cannot modify header information 的问题,在你程序最开始加上ob_start();