Php
marwan
-
marwan -
marwan -
Bonjour,
j'ai toujours un probleme a chaque fois si je valide il menvoie ceci
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\EasyPHP 2.0b1\www\gestion_stage\create\index.php:104) in C:\Program Files\EasyPHP 2.0b1\www\gestion_stage\create\tFrmDomaines.php on line 36
et mon code tt est normal
voila mon code
<!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=iso-8859-1" />
<title>Document sans titre</title>
</head>
<body>
<?php
//session_start();
if(!isset($_POST['enregistrer']))
include_once('frmDomaines.php');
else
{
require_once('connexion.php');
extract($_POST);
$sql="insert into domaine (numero_domaine, nom_domaine) values ('', '$dom')";
$exe=mysql_query($sql, $db) or die(mysql_error());
$numdom=mysql_insert_id();
if(!$exe)
exit;
foreach($_SESSION['tab'] as $val)
{
$tab=explode(';', $val);
$sql="insert into definircritere (numero_domaine, numcritere, standard) values ($numdom, ".$tab[0].", '".$tab[2]."')";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
foreach($_SESSION['obj'] as $val)
{
$tab=explode(';', $val);
$sql="insert into fixer (numero_domaine, numobj) values ($numdom, ".$tab[0].")";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
if($exe)
header('location:confirm.php?val=dom');
else
header('location:error.php');
}
?>
</body>
</html>
si quelqu'un a une solution pour cela
j'ai toujours un probleme a chaque fois si je valide il menvoie ceci
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\EasyPHP 2.0b1\www\gestion_stage\create\index.php:104) in C:\Program Files\EasyPHP 2.0b1\www\gestion_stage\create\tFrmDomaines.php on line 36
et mon code tt est normal
voila mon code
<!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=iso-8859-1" />
<title>Document sans titre</title>
</head>
<body>
<?php
//session_start();
if(!isset($_POST['enregistrer']))
include_once('frmDomaines.php');
else
{
require_once('connexion.php');
extract($_POST);
$sql="insert into domaine (numero_domaine, nom_domaine) values ('', '$dom')";
$exe=mysql_query($sql, $db) or die(mysql_error());
$numdom=mysql_insert_id();
if(!$exe)
exit;
foreach($_SESSION['tab'] as $val)
{
$tab=explode(';', $val);
$sql="insert into definircritere (numero_domaine, numcritere, standard) values ($numdom, ".$tab[0].", '".$tab[2]."')";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
foreach($_SESSION['obj'] as $val)
{
$tab=explode(';', $val);
$sql="insert into fixer (numero_domaine, numobj) values ($numdom, ".$tab[0].")";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
if($exe)
header('location:confirm.php?val=dom');
else
header('location:error.php');
}
?>
</body>
</html>
si quelqu'un a une solution pour cela
A voir également:
- Php
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour à la ligne php ✓ - Forum PHP
- Alert php - Forum PHP
- Retour a la ligne php ✓ - Forum PHP
2 réponses
le header doit être envoyé AVANT TOUTE BALISE ou caratere HTMl
donc:
donc:
<?php
session_start();
if(!isset($_POST['enregistrer']))
include_once('frmDomaines.php');
else
{
require_once('connexion.php');
extract($_POST);
$sql="insert into domaine (numero_domaine, nom_domaine) values ('', '$dom')";
$exe=mysql_query($sql, $db) or die(mysql_error());
$numdom=mysql_insert_id();
if(!$exe)
exit;
foreach($_SESSION['tab'] as $val)
{
$tab=explode(';', $val);
$sql="insert into definircritere (numero_domaine, numcritere, standard) values ($numdom, ".$tab[0].", '".$tab[2]."')";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
foreach($_SESSION['obj'] as $val)
{
$tab=explode(';', $val);
$sql="insert into fixer (numero_domaine, numobj) values ($numdom, ".$tab[0].")";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
if($exe)
header('location:confirm.php?val=dom');
else
header('location:error.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=iso-8859-1" />
<title>Document sans titre</title>
</head>
<body>
</body>
</html>
Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\EasyPHP 2.0b1\www\gestion_stage\create\index.php:104) in C:\Program Files\EasyPHP 2.0b1\www\gestion_stage\create\tFrmDomaines.php on line 27
voici la code
<?php
//session_start();
if(!isset($_POST['enregistrer']))
include_once('frmDomaines.php');
else
{
require_once('connexion.php');
extract($_POST);
$sql="insert into domaine (numero_domaine, nom_domaine) values ('', '$dom')";
$exe=mysql_query($sql, $db) or die(mysql_error());
$numdom=mysql_insert_id();
if(!$exe)
exit;
foreach($_SESSION['tab'] as $val)
{
$tab=explode(';', $val);
$sql="insert into definircritere (numero_domaine, numcritere, standard) values ($numdom, ".$tab[0].", '".$tab[2]."')";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
foreach($_SESSION['obj'] as $val)
{
$tab=explode(';', $val);
$sql="insert into fixer (numero_domaine, numobj) values ($numdom, ".$tab[0].")";
$exe=mysql_query($sql, $db) or die(mysql_error());
}
if($exe)
header('location:confirm.php?val=dom');
else
header('location:error.php');
}
?>