|
![](/images/resource/spacer.gif) |
|
ใช้ PHP mysqli แล้วใช้คำสั่ง Header ไม่ได้ครับ ขึ้น Warning: Cannot modify header information - headers already sent by.... |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
เออเร่อร์ มันบอกบันทัดไหนบ้าง เอาบันทัดที่บอก ของ ไฟล์ที่เกี่ยวข้องมาให้ดูครับ
โค๊ดข้างบน ไม่เกี่ยวครับ ไม่มีคำสั่งส่งข้อความไปยัง client
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-08-31 23:29:20 |
By :
NewbiePHP |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
ต้องดู code ที่ใช้ Header ครับ
เพราะของผมที่ใช้ประมาณว่าเช็ค login แล้ว Header ไปอีกหน้า พอไปกดปิดเว็บ แล้วเข้าระบบ login ใหม่มันจะแจ้งแบบที่เจ้าของโพสครับ ในแบบผมคือต้อง logout ก่อน (ไม่รู้ว่าจะเหมือนกันไหมนะ)
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-09-01 00:05:50 |
By :
zadstoms |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
Code (PHP)
session_start();
ini_set('display_errors',1);
error_reporting(~0);
$servername = "localhost";
$username = "admin";
$userpassword = "1234";
$dbname = "data";
$conn = mysqli_connect($servername,$username,$userpassword,$dbname);
$conn->query("set names utf8");
//ตรวจรูปแบบ email
if (!preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/',$_POST["email"])){
$_SESSION["email"]='invalid';
session_write_close();
header("location:http://website.com/");
exit(0);
}
นี่อะครับ โค๊ดของผม ต้องปรับแก้ตรงไหนบ้างครับ
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-09-01 19:15:26 |
By :
pxmaster |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
เฮ้อ! ทำไมเห็น error message ไม่มีความสำคัญขนาดนี้ครับ
เอามาแค่บางส่วน จะแก้ปัญหามันก็แค่เดาเอา อ้างอิงจากบันทัดไหน เอ่อเร่อร์บันทัดไหน ก็ไม่บอก
เขียนโปรแกรมคอมฯ มันต้องชัดเจนเรื่องข้อมูล อย่าต้องให้เดากันเลยครับ
ครั้งนีก็ต้องเดาแถมต้องอ่านโค๊ดมันทุกบันทัด เสียเวลาครับ โค๊ดไม่ได้ผิด
เดาว่าไฟล์ที่เก็บ เป็น ไฟล์ชนิด with BOM ลองแก้ไฟล์ type ที่ใช้เก็บข้อมูลใหม่
อย่าใช้ with BOM
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2015-09-02 06:39:09 |
By :
NewbiePHP |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 02
|