c'est le nom de cette variable qui est testé par
isset($_POST['connexion'])
rajoute NAME="connexion" dans ta balise <INPUT .... ><?php
// demarre une session
session_start();
// Connection au serveur mySQL
$sql_serveur = "localhost"; // Serveur mySQL
$sql_base = "offres"; // Base de donnees mySQL
$sql_login = "root"; // Login de connection a mySQL
$sql_password = "root"; // Mot de passe pour mySQL
$nom_fichier = "offre.php"; // Nom de votre page
// ex: index.php si ce script est sur la page index.php
if(isset($_POST['connexion']))
{
echo 'formulaire valide<BR>';
//ton formulaire a été validé précedement
$connexion = mysql_connect($sql_serveur, $sql_login, $sql_password);
if($connexion!==FALSE)
{
echo 'la connection a reussi, $connexion : ' . $connexion . '<BR>';
//la connection a été réussi, on dirige vers l'autre page
mysql_select_db($sql_base);
header('offre.php');
}
else echo 'la connexion a echouee, $connexion : ' . $connexion . '<BR>';
}
?>
<html>
<head>
<title>Titre</title>
</head>
<body>
<div align="center"><strong>Veuillez entrer votre Login et Mot de Passe:</strong><br /><br/>
</div>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<div align="center">
<input type="hidden" name="action" value="1">
Login:
<input type="password" name="login">
<br />
Passe:
<input type="password" name="pass">
<br />
<input type="submit" value="connexion">
</div>
</form>
<?php
if(isset($_POST['connexion']) && ($connexion===FALSE))
{
die('<font color="red">Informations incorrectes!');
}
?>
</body>
</html>
voilà au moins là il essaie d'executer la fonction header.Warning: Cannot modify header information - headers already sent by (output started at p:\easyphp1-8\www\site\formulaire\login2.php:17) in p:\easyphp1-8\www\site\formulaire\login2.php on line 27