พี่วินค่ะ เว็บบอร์ดมัน Error ค่ะมันเป็นเพราะอะไรค่ะ ยังไงถ้าหากผู้มีความรู้โปรดบอกหน่อยนะคะ .... Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\Maefahluang\NewQuestion.php:3) in C:\AppServ\www\Maefah
Code (PHP)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><br>
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("meafahlung");
if($_GET["Action"] == "Save")
{
//*** Insert Question ***//
$strSQL = "INSERT INTO webboard ";
$strSQL .="(CreateDate,Question,Details,Name) ";
$strSQL .="VALUES ";
$strSQL .="('".date("Y-m-d H:i:s")."','".$_POST["txtQuestion"]."','".$_POST["txtDetails"]."','".$_POST["txtName"]."') ";
$objQuery = mysql_query($strSQL);
header("location:Webboard.php");
}
?>
<html>
<head>
</head>
<body>
<form action="NewQuestion.php?Action=Save" method="post" name="frmMain" id="frmMain">
<table width="621" border="1" cellpadding="1" cellspacing="1">
<tr>
<td>เรื่อง</td>
<td><input name="txtQuestion" type="text" id="txtQuestion" value="" size="70"></td>
</tr>
<tr>
<td width="78">รายละเอียด</td>
<td><textarea name="txtDetails" cols="50" rows="5" id="txtDetails"></textarea></td>
</tr>
<tr>
<td width="78">โดย</td>
<td width="647"><input name="txtName" type="text" id="txtName" value="" size="50"></td>
</tr>
</table>
<input name="btnSave" type="submit" id="btnSave" value="บันทึก">
<input type="reset" name="Reset" id="button" value="Reset">
</form>
</body>
</html>
<?
mysql_close($objConnect);
?>
Tag : PHP, MySQL, HTML/CSS, JavaScript, CakePHP
Date :
2012-11-14 19:43:45
By :
โลโก้
View :
828
Reply :
3
Code (PHP)
<?
$objConnect = mysql_connect("localhost","root","root") or die("Error Connect to Database");
$objDB = mysql_select_db("meafahlung");
if($_GET["Action"] == "Save")
{
//*** Insert Question ***//
$strSQL = "INSERT INTO webboard ";
$strSQL .="(CreateDate,Question,Details,Name) ";
$strSQL .="VALUES ";
$strSQL .="('".date("Y-m-d H:i:s")."','".$_POST["txtQuestion"]."','".$_POST["txtDetails"]."','".$_POST["txtName"]."') ";
$objQuery = mysql_query($strSQL);
header("location:Webboard.php");
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<form action="NewQuestion.php?Action=Save" method="post" name="frmMain" id="frmMain">
<table width="621" border="1" cellpadding="1" cellspacing="1">
<tr>
<td>เรื่อง</td>
<td><input name="txtQuestion" type="text" id="txtQuestion" value="" size="70"></td>
</tr>
<tr>
<td width="78">รายละเอียด</td>
<td><textarea name="txtDetails" cols="50" rows="5" id="txtDetails"></textarea></td>
</tr>
<tr>
<td width="78">โดย</td>
<td width="647"><input name="txtName" type="text" id="txtName" value="" size="50"></td>
</tr>
</table>
<input name="btnSave" type="submit" id="btnSave" value="บันทึก">
<input type="reset" name="Reset" id="button" value="Reset">
</form>
</body>
</html>
<?
mysql_close($objConnect);
?>
Date :
2012-11-14 23:23:53
By :
sakuraei
ลองเพิ่มโค๊ดนี้ไว้บนสุดของเพจนะครับ
<?PHP
ob_start();
?>
Date :
2012-11-18 15:25:41
By :
arm8957
Load balance : Server 05