Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2111 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Problème de redirection

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème de redirection

n°1336138
Asmodee4
Posté le 31-03-2006 à 10:55:40  profilanswer
 

Bonjour,
 
       Voici mon problème :
 
          Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\adminldap\login.php:13) in c:\program files\easyphp1-8\www\adminldap\login.php on line 17
 
       Voici le code :
 
1. <?php
2. session_start();
3. if(isset($_SESSION['etat'])){
4.  $_SESSION['login']=$_POST['login'];
5.  $_SESSION['mdp']=$_POST['mdp'];
6. }
7. require "configuration\\divers.php";
8.?>
9.<html>
10.<head>
11.<title>Administration LDAP</title>
12.</head>
13.<?php
14. $lien=$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['PHP_SELF']),'/\\')."/index.php";
15. if (isset($_SESSION['etat'])){
16.  if ($_SESSION['mdp']=="" ) {
17.   header ("Location: http://".$lien."?erreur=1" );
18.  }else {
19.   if($ds=ldap_connect("localhost" )){
20.    @ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
21.    if (@ldap_bind($ds, $_SESSION['login'], $_SESSION['mdp'])){
22.     $_SESSION['ConnexionLDAP']=$ds;
23.     echo "<frameset border=0 cols=\"20%,80%\">";
24     echo " <frame src=\"menu.php\" name=\"menu\">";
25.     echo " <frame src=\"accueil.php\" name=\"pageprinc\">";
26.     echo "</frameset>";
27.    }else
28.            header ('Location: index.php?erreur=0');
29.   }else
30.    echo "Impossible de se connecter à l'annuaire.";
31.  }
32. }else
33.  header("Location: http://".$lien);
34.?>
35.</html>

mood
Publicité
Posté le 31-03-2006 à 10:55:40  profilanswer
 

n°1336146
olivthill
Posté le 31-03-2006 à 11:02:14  profilanswer
 

Le problème est causé par les lignes 9 à 12 incluse.
Elle constituent le début d'une page.
Or, header("Location"... doit être envoyé avant le début d'une page.

n°1336147
anapajari
s/travail/glanding on hfr/gs;
Posté le 31-03-2006 à 11:02:37  profilanswer
 

[:recherche]

n°1336148
j_lecruel
☀ ☁ ☂
Posté le 31-03-2006 à 11:02:48  profilanswer
 

http://forum-images.hardware.fr/themes_static/images_forum/1/recherche.gif
 
Sujet maintes fois traité sur le forum...
 
http://forum.hardware.fr/forum1.ph [...] deration=0


---------------
♈ ♋ ♌ ♍ ♎ ♏ - Agora Fidelio | Galerie d'art Toulousaine
n°1336150
Asmodee4
Posté le 31-03-2006 à 11:04:52  profilanswer
 

Merci.


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Problème de redirection

 

Sujets relatifs
problème de redirectionProblème avec exec et la redirection vers un fichier
problème redirection site webProblème redirection avec header
probleme de redirection [resolu]Problème PHP / Redirection transparente
[PHP] Problème de redirection[JS] petit probleme avec un script de redirection
Petit probleme de redirection apres actualisation de la page.redirection par une boite de selection.. problème avec "_blank"
Plus de sujets relatifs à : Problème de redirection


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR