1.Код
<body>
<?php
setcookie("name1","value");
echo $_COOKIE["name1"]
?>
</body>
Oшибка:
Warning: Cannot modify header information - headers already sent by (output started at Z:\home\localhost\www\index.php:9) in Z:\home\localhost\www\index.php on line 10..
Проблема в настройках сервера?
2.
<?php
session_start();
$_SESSION["ses"]=100;
echo $_SESSION["ses"];
?>
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at Z:\home\localhost\www\index.php:9) in Z:\home\localhost\www\index.php on line 10
<?php
include('1.php');
?>
<!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=windows-1251" />
<title>Документ без названия</title>
</head>
<body>
<?php
echo $_SESSION["ses"];
?>
</body>
Код 1.php
<?php session_start(); $_SESSION["ses"]=100;
?>