<?php
setcookie("mr",'MYKYLE');
echo "读取cookie".$_COOKIE['mr'];?>
简单的代码,为什么会报错
Warning: Cannot modify header information - headers already sent by (output started at D:\PHP\index.php:7) in D:\PHP\index.php on line 19
setcookie("mr",'MYKYLE');
echo "读取cookie".$_COOKIE['mr'];?>
简单的代码,为什么会报错
Warning: Cannot modify header information - headers already sent by (output started at D:\PHP\index.php:7) in D:\PHP\index.php on line 19
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My kyle</title>
</head>
<?php
setcookie("mr",'MYKYLE');echo "读取cookie".$_COOKIE['mr'];?>
<body>
</body>
</html>