Page 1 sur 1

Redirection vide avec header

Posté : 24 mai 2010, 00:47
par smile88
Bonjour,

quand je clique sur button submit il doit se rediriger sur une des deux pages selon le login et le mot de passe mais il m'affiche une page blanche :cry: :cry: #-o #-o
<?php

include('conf.php');

$log = $_POST['login'];

$pwd =$_POST['pwd'];



$sql =  mysql_query("SELECT * FROM user WHERE LOGIN ='$log'"); 

if(!$sql){

    echo("<body><p align='center'>Une erreur est survenue lors de la tentative de connexion</p></body>");

  }

else{

    if(mysql_num_rows($sql) == 0){

      echo("<body><p  align='center'>Le nom d'utilisateur ".$log." n'existe pas</p></body>");

    }

    else{

      $row = mysql_fetch_array($sql);

      if($pwd != $row["PASS"]){

        echo("<body><p align='center'>Votre mot de passe est incorrect</p></body>");

      }

      else{

           if ($row['PROFIL'] == "admin")

             {header ('location :Administrateur/admin_frame.htm'); }

           else {header ('location : projet_frame.htm');}

             session_start();

             $_SESSION['NOM'] = $row['NOM'];          

             $_SESSION['PRENOM'] = $row['PRENOM'];

             $_SESSION['EMAIL'] = $row['EMAIL'];

      }

    }

  }

?>

Re: Redirection vide avec header

Posté : 24 mai 2010, 07:39
par blof
Bonjour,
header ('Location: Administrateur/admin_frame.htm');
(il n'y a pas d'espace entre "Location" et ":")


[HS]
renseigne toi sur les injections SQL.
http://www.php.net/manual/fr/security.d ... ection.php
http://www.php.net/manual/fr/function.m ... string.php
[/HS]