Sujet certainement récurrent mais je n'y connais rien....
Posté : 23 juil. 2008, 12:29
Bonjour, on m'a développer une application php que je fais fonctionnement avec esayphp sur mon pc portable sans problème.
J'ai voulu intégrer la base de données dans mon nas synology. Pas de souci, base de donées crée. J'ai ensuite réimporter les fichier du dossier www de esayphp. Pas de souci. Mais quand je veux me connecter avec admin/admin j'ai ce message d'erreur :
Warning: Cannot modify header information - headers already sent by (output started at /volume1/web/conduite_ligne_faconnage/admin/index.php:12) in /volume1/web/conduite_ligne_faconnage/admin/index.php on line 25
Voila le code pour index.php
Voilà le code pour bandeau_haut
Quelqu'un à une idée sur mon problème?
merci d'avance
Thomas
J'ai voulu intégrer la base de données dans mon nas synology. Pas de souci, base de donées crée. J'ai ensuite réimporter les fichier du dossier www de esayphp. Pas de souci. Mais quand je veux me connecter avec admin/admin j'ai ce message d'erreur :
Warning: Cannot modify header information - headers already sent by (output started at /volume1/web/conduite_ligne_faconnage/admin/index.php:12) in /volume1/web/conduite_ligne_faconnage/admin/index.php on line 25
Voila le code pour index.php
<?php require "../includes/odbc_admin.php";
// déclaration des variables
if (!empty($_POST['send'])) { $send = $_POST['send']; } else { $send = "";}
if (!empty($_POST['login'])) { $login = $_POST['login']; } else { $login = ""; }
if (!empty($_POST['pwd'])) { $pwd = $_POST['pwd']; } else { $pwd = ""; }
if (!empty($_GET['err'])) { $err = $_GET['err']; } else { $err = "";}
if (!empty($_GET['n'])) { $n = $_GET['n']; } else { $n = "";}
?>
<link rel=stylesheet href="../includes/style_home.css">
<?php
// -------------------------------------------------------------------------------------
// Test Login
// -------------------------------------------------------------------------------------
if ($send =='Accés sécurisé') {
$sql = "SELECT * FROM utilisateur WHERE login='".$login."' AND pwd='".$pwd."'";
$recherche = mysql_query($sql);
if ($affichage = mysql_fetch_array($recherche)) {
$_SESSION['id_utilisateur'] = $affichage['id'];
$_SESSION['utilisateur'] = "ok";
$_SESSION['admin'] = $affichage['administrateur'];
if ($affichage['administrateur']==true) {
header("location:bandeau_haut.php");
} else {
header("location:document_utilisateur.php");
}
} else {
$err = 1;
$_SESSION['utilisateur'] = "";
}
}
?>
<!------------------------------------------------------->
<!--------------------Début de page---------------------->
<!------------------------------------------------------->
<script>
</script>
<br><br><br><br><br><br><br>
<form name=f action="index.php" method=post onSubmit="return verif();">
<center>
<table class=norm border=0 cellspacing=10 cellpadding=5>
<tr>
<td valign=top>
<table width=100% border=1 bordercolor=#8a8a8a cellspacing=0 cellpadding=5 class=norm >
<tr bgcolor=#8a8a8a style="color:#ffffff">
<td colspan=3><b>Administration</td>
</tr>
<tr>
<td>
<table width=100% border=0 cellspacing=0 cellpadding=5 class=norm >
<tr>
<td width=150><b>Login : </td>
<td><input class=champ type=text name=login id=login size=20 maxlength=202></td>
</tr>
<tr>
<td width=150><b>Mot de passe : </td>
<td><input class=champ type=password name=pwd id=pwd size=20 maxlength=20></td>
</tr>
<tr>
<td colspan=3 align=center><br><input class=bouton type=submit name=send id=send value="Accés sécurisé"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</form>
<!------------------------------------------------------->
<!--------------------Fin de page---------------------->
<!------------------------------------------------------->
<script language=javascript>f.login.focus();</script>
<script>
function alerte(pos,txt){alert(txt);pos.focus();return false;}
function verif (){
if(document.getElementById('login').value=='') return alerte(document.getElementById('login'),'Veuillez indiquer votre login');
if(document.getElementById('pwd').value=='') return alerte(document.getElementById('pwd'),'Veuillez indiquer votre mot de passe' );
}
<?php if ($err=='1') { ?>
alert('Le login ou le mot de passe que vous avez entré est incorrect.')
<?php
}
if ($n==1) { ?>
alert('Vous avez été déconnecté pour des raisons de sécurité.\nPour accéder au site, veuillez vous identifier.');
<?php } ?>
Voilà le code pour bandeau_haut
<?php require "./includes/haut.php"; ?>
<br><br>
<center>
<?php
$sql ="SELECT * FROM bandeau";
$recherche = mysql_query($sql);
$couleur="";
if ($affichage = mysql_fetch_array($recherche)) {
$couleur = $affichage['couleur'];
}
if ($couleur!="") {
//$couleur = substr($couleur,1);
//$couleur = substr($couleur,1);
}
?>
<table border=0 class=norm cellpadding=2 cellspacing=0 width="500">
<form name=f action="bandeau_haut_exe.php" method="post" ENCTYPE="multipart/form-data">
<tr>
<td>Image d'accueil</td><td> : <input type=file name=image_accueil class=champ></td>
</tr>
<tr>
<td>Image du bandeau</td><td> : <input type=file name=image_bandeau class=champ></td>
</tr>
<tr>
<td>Image du logo</td><td> : <input type=file name=image_logo class=champ></td>
</tr>
<tr>
<td>Couleur de fond</td><td>
<table border=0 class=norm cellpadding=0 cellpacing=0>
<tr>
<td>: </td>
<td>
<table border=0 class=norm cellpadding=1 cellspacing=0 class=norm style='width:140px;border:1px solid black;<?php if($couleur!="") {echo "background-color:#".$couleur.";";}?>' id='tableau_cou'>
<tr>
<td> </td>
</tr>
</table>
</td>
<td> <input type=hidden name=couleur id=couleur value="<?php echo $couleur;?>"><img src="../graphs/bt_couleur.jpg" align="absmiddle" onClick="aff_couleur();"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td colspan=2><iframe name=choix_couleur id=choix_couleur frameborder="0" scrolling="no" src="select_color.html" width=190 height=162 style='margin-left:5px;'></iframe></td>
</tr>
<tr>
<td colspan=2><center><input type=submit name="Valider" value="Valider" class=bouton></center></td>
</tr>
</form>
</table>
</center>
<script>
function aff_couleur() {
document.getElementById('choix_couleur').setAttribute("src","select_color.html");
}
</script>
<?php require "./includes/bas.php"; ?>[/php]Quelqu'un à une idée sur mon problème?
merci d'avance
Thomas