帮帮忙:关于cookie的一个问题.为什么会出现这样一个"warning" setcookie前面输出,你的前7行都是什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是第八行出错,而是第八行后面的语句出错,你把 $aquery="insert into users(firstname,lastname) values ('$fn','$ln')"; 放在同一行看看还有没有错? 你第16行有header函数,在它前面不能有任何输出,包括空格,估计你第8行前面有空格,就是<?php 这一行的前面有输出,很有可能是空格 非常谢谢你们"<?php " 前七行的语句为<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title></head></body>算不算有输出呢?如果算,我要怎么做才可以呢?<body> setcookie("CookieID", mysql_insert_id(), time()+3600);//set cookie 第16行}?>把那7行放在这里<form name="a" action="testcookie.php?action=inp" method="post"> <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title></head><?php$link=mysql_connect("localhost","root");mysql_select_db("zonghe",$link);if($_GET['action']=="inp"){ $fn=$_POST['fn']; $ln=$_POST['ln']; $aquery="insert into users(firstname,lastname) values ('$fn','$ln')"; mysql_query("$aquery"); setcookie("CookieID", mysql_insert_id(), time()+3600); echo $_COOKIE['CookieID'];}?><body> //....<form name="" action="testcookie.php?action=inp" method="post"><table width="60%" border="1" cellspacing="0" cellpadding="0"> <tr> <td>firstname:<input type="text" name="fn" ></td> </tr> <tr><td>lastname:<input type="text" name="ln"></td></tr> <tr><td><input type="submit" name="sub" value="submit"></td></tr></table></form></body></html>我已按你的说法作了调整.运行结果为:Warning: Cannot modify header information - headers already sent by (output started at E:\test\testcookie.php:6) in E:\test\testcookie.php on line 14为什么呢?各位大侠,帮帮我... php怎么保存一棵树 求助一个在多页面间提交php数据的问题 PHP和Java的兄弟进来看一下,一个URLencode问题 求助 写一个PHP函数,它查找并且返回某个数组的最大值。并附上测试结果 eval的问题,头大,各位大侠帮帮忙 get传递的疑惑 请教正则必须包含如何匹配呢 么样让打开的页面在永远在最上面? 请你提议见!!! 请各位大虾帮个忙. 在win2000下安装apache和php碰到个小问题 救命! 帮帮忙:关于cookie的一个问题.如何解决出现"warning"这个的问题。
前七行的语句为
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head></body>
算不算有输出呢?如果算,我要怎么做才可以呢?
<body>
}
?>
把那7行放在这里
<form name="a" action="testcookie.php?action=inp" method="post">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<?php
$link=mysql_connect("localhost","root");
mysql_select_db("zonghe",$link);
if($_GET['action']=="inp"){
$fn=$_POST['fn'];
$ln=$_POST['ln'];
$aquery="insert into users(firstname,lastname) values ('$fn','$ln')";
mysql_query("$aquery");
setcookie("CookieID", mysql_insert_id(), time()+3600);
echo $_COOKIE['CookieID'];
}
?>
<body> //....
<form name="" action="testcookie.php?action=inp" method="post">
<table width="60%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td>firstname:<input type="text" name="fn" ></td>
</tr>
<tr><td>lastname:<input type="text" name="ln"></td></tr>
<tr><td><input type="submit" name="sub" value="submit"></td></tr>
</table>
</form>
</body>
</html>我已按你的说法作了调整.运行结果为:
Warning: Cannot modify header information - headers already sent by (output started at E:\test\testcookie.php:6) in E:\test\testcookie.php on line 14为什么呢?
各位大侠,帮帮我...