<?
session_start();
$a=$_POST['txtusername'];
$b=$_POST['txtpassword'];
$_SESSION['username']=$_POST['txtusername'];
$_SESSION['password']=$_POST['txtpassword'];
$cb_user=$_POST['cb_user'];
echo $cb_user;
if($cb_user='1'){
//setcookie(var,value,[Time-Expire]); // Set Cookies
$strSiteName = "ThaiCreate.Com";
setcookie("username",$a,time()+3600);
setcookie("password",$b,time()+3600);// Expire 1 Hour
}
?>
<script language="javascript">
//window.location="view.php";
</script>
<a href="view.php">ลงทะเบียน session & cookies เรียบร้อย
</a>
แล้วมันฟ้อง error ว่าแบบนี้ครับ
Quote:
1
Warning: Cannot modify header information - headers already sent by (output started at G:\AppServ\www\test\result.php:8) in G:\AppServ\www\test\result.php on line 13
Warning: Cannot modify header information - headers already sent by (output started at G:\AppServ\www\test\result.php:8) in G:\AppServ\www\test\result.php on line 14
ลงทะเบียน session & cookies เรียบร้อย