Re: [請益] php在iis5上的執行
※ 引述《love417 (一直在找一個人)》之銘言:
: 網頁建置是用appserv
: 可是放上server的時候卻跑出這樣的錯誤
: Warning: Cannot modify header information - headers already sent by (output
: started at C:\Inetpub\wwwroot\breeder\login.php:2) in
: C:\Inetpub\wwwroot\breeder\login.php on line 9
: Warning: Cannot modify header information - headers already sent by (output
: started at C:\Inetpub\wwwroot\breeder\login.php:2) in
: C:\Inetpub\wwwroot\breeder\login.php on line 10
: server上
: 平台是2000 server版
: php-4.3.11
: mysql-4.0.24
: 下面附上原始檔
: <?php
: mysql_connect ("localhost", "xxxxx", "xxxxx");
: mysql_select_db("mytest");
: $sql="select user,passwd from t7 where user='$userid' and passwd='$passwd'"
: ;
: $result=mysql_query($sql);
: $num=mysql_num_rows($result);
: if($num>0){
: setcookie("username",$userid);
: header("location:frameset-1.htm");
: }else{
: echo" 沒$userid這個人!!";
: };
: ?>
: 直覺上應該是設定有錯
: 可是又不知道去改哪@@"
呃...自己回應一下
我同學在別的論壇幫我問了
解決的方法為在程式前後加上
ob_start();跟ob_end_flush();
用了的確可以跑了 ̄□ ̄
查了一下書這個指令是暫存用的
為啥這樣就可以跑啊...
--
有時候
不是你拋棄了誰,
或是誰背叛了你,
而是時候到了.,
自然分離.
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.120.98.132
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章