[請益] php的問題

看板PHP作者 (roger70349)時間19年前 (2007/02/07 16:29), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/5 (看更多)
請大大能否幫我看一下下面的程式 <body> <? include_once("sql_connect.php"); include_once("my_msg.php"); ?> <? //檢核資料 if($_POST['id']=='' or $_POST['password']==''){ my_msg("欄位不可空白","admin_login.html"); } $sqlstr="select * from admin where id ='".$_POST['id']."' and password = '".$_POST['password']."'"; $result = mysql_query($sqlstr,$link); $row = mysql_fetch_array($result); if(mysql_num_rows ($result)){ setcookie("cookie_chk", "admin_logined"); setcookie("cookie_id", $_POST['id']); my_header("adm.php"); // 管理者登入 }else{ my_msg("登入失敗,請重新登入","admin_login.html"); } mysql_free_result($result); mysql_close($link); ?> <form method="post"></form> </body> 能否幫我看一下是那裡出了問題 其執行結果是 Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\danshui\member\admin_chk.php:3) in D:\AppServ\www\danshui\member\admin_chk.php on line 22 Warning: Cannot modify header information - headers already sent by (output started at D:\AppServ\www\danshui\member\admin_chk.php:3) in D:\AppServ\www\danshui\member\admin_chk.php on line 23 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.21.78.208

02/07 16:39, , 1F
header() 前面不能送資料<body>; or 開buffer
02/07 16:39, 1F
文章代碼(AID): #15oOu5aR (PHP)
文章代碼(AID): #15oOu5aR (PHP)