par
kiss20 » 01 avr. 2007, 22:46
Salut,
J'ai un gros problème avec la fonction header() utiliser pour des redirections.
J'ai ce message d'ereur :
Warning: Cannot modify header information - headers already sent by (output started at c:\site\index.php:13) in c:\site\index.php on line 3
Voici mon code source :
Code : Tout sélectionner
<?php
function redirection()
{
header("Location: index.php?page=result");
exit;
}
session_start();
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>'; /* Ligne 13 */
echo '<style type="text/css">
a
{
color: #94999d;
text-decoration: none;
}
a:hover
{
color: #4c5256;
}
</style>
<body>
/* Includes */
</body>
</html>';
?>
Je n'arrive pas à trouver mon erreur.
Quelqu'un pourrait m'aider.
Merci
Salut,
J'ai un gros problème avec la fonction header() utiliser pour des redirections.
J'ai ce message d'ereur :
[quote]Warning: Cannot modify header information - headers already sent by (output started at c:\site\index.php:13) in c:\site\index.php on line 3[/quote]
Voici mon code source :
[code]<?php
function redirection()
{
header("Location: index.php?page=result");
exit;
}
session_start();
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>'; /* Ligne 13 */
echo '<style type="text/css">
a
{
color: #94999d;
text-decoration: none;
}
a:hover
{
color: #4c5256;
}
</style>
<body>
/* Includes */
</body>
</html>';
?>
[/code]
Je n'arrive pas à trouver mon erreur.
Quelqu'un pourrait m'aider.
Merci