slam:ws:2011:ppe2.2:equipe9:accueil
Table des matières
Mission N°9
Semaine N°1
Formulaire de connexion
Aspect Graphique
Aspect Porgrammation
<!DOCTYPE html> <html> <head> <title>Connexion</title> </head> <body> <form method="get" action="action_connexion.php"></br> <fieldset width="10"> <table> <span class="titre"><p><Strong> Connexion </Strong></p></span> <tr align="left"> <td>Identifiant : </td><td><input type="id" name="identifiant"></br></td> </tr> <tr> <td>Mot de passe : </td><td><input type="password" name="motDePasse"></br></td> </tr> <tr> <td><input type="submit" value="Entrer"></br></td> </tr> </table> </fieldset> </form> </body> </html>
Création de la page de gestion des salles
Aspect Graphique
Aspect Porgrammation
Tableau de gestion des salles:
<html>
<head><title>Gestion des salles</title></head>
<body>
<?php
try
{
$connexion = new PDO('mysql:host=localhost;dbname=bdarbitres','root','');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$resultat=$connexion->query('SELECT * FROM salle');
?>
<h1>Gestion des salles</h1>
<table border="1px solid black">
<tr>
<td>N°salle</td>
<td>Adresse salle</td>
<td>Modifier</td>
<td>Supprimer</td>
</tr>
<?php
while($ligne=$resultat->fetch())
{
?>
<tr>
<td><?php echo $ligne['NUM_SALLE'];?></td>
<td><?php echo $ligne['ADRESSE_SALLE'];?></td>
<td><a href="formulaire/form.salles.modifier.php?num=<?php echo $ligne['NUM_SALLE'];?>">Modifier</a></td>
<td><a href="action/action.salles.supprimer.php?num=<?php echo $ligne['NUM_SALLE'];?>">Supprimer</a></td>
</tr>
<?php
}
$resultat->closeCursor();
?>
</table>
</br>
<a href="formulaire/form.salles.ajouter.php">Ajout d'une salle</a>
</body>
</html>
Formulaire d'ajout
Aspect Graphique
Aspect Porgrammation
Le formulaire lui même:
Et l'action qui ajoute à la base de donnée:
<body>
<?php
try
{
$connexion = new PDO('mysql:host=localhost;dbname=bdarbitres','root','');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$resultat=$connexion->prepare('insert into salle (ADRESSE_SALLE) values (:adrsalle)');
$resultat->execute(array('adrsalle'=>$_GET['adrsalle']));
header("Location: ../gestion.salles.php");
?>
</body>
Semaine N°2
Action de la connexion
Aspect Porgrammation
<?php
session_start();
$_SESSION = array();
try
{
$connexion = new PDO('mysql:host=localhost;dbname=laroute_gite','laroute_gite','btssio');
}
catch(Exception $e)
{
die('Erreur : '.$e->getMessage());
}
$req = $connexion -> prepare ('SELECT * FROM connexion WHERE identifiant = :identifiant');
$req -> execute (array('identifiant' =>($_GET['identifiant'])));
$resultat = $req -> fetch();
if (!$resultat)
{
echo 'Mauvais identifiant ou mauvais mot de passe !';
?>
</br>
<A HREF="index.php">Retour</A>
<?php
}
else
{
if ($resultat ['motDePasse']!=$_GET['motDePasse']) {
echo 'Mauvais identifiant ou mauvais mot de passe !';
?>
</br>
<A HREF="index.php">Retour</A>
<?php
}
else
{
$_SESSION['identifiant'] = $resultat ['identifiant'];
//echo 'Vous êtes connecté !';
header("Location: ../PPE/index.php");
}
}
?>
Formulaire de modification
Semaine N°3 & N°4
Edition format PDF
slam/ws/2011/ppe2.2/equipe9/accueil.txt · Dernière modification : 2014/01/07 13:56 de 127.0.0.1



