par
donny » 25 mai 2005, 11:12
en faite voila tout le code
$_SESSION c est comme SESSION_REGISTER
<!-- Fichier : formulaire.html -->
<html>
<body>
<form method="post" action="traitement.php">
<table border="0">
<tr>
<td><u>Nom :</u></td>
<td>
<input type="text" name="cNom" size="20" value="RIVES">
</td>
</tr>
<tr>
<td><u>Prénom :</u></td>
<td>
<input type="text" name="cPrenom" size="20" value="Jean-Pierre">
</td>
</tr>
<tr>
<td><u>eMail :</u></td>
<td>
<input type="text" name="cEmail" size="20"
value="[email protected]">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="soumettre" value="Envoyer">
</td>
</tr>
</table>
</form>
</body>
</html>
<!-- Fichier : traitement.php -->
<?
session_start();
$nom = $cNom;
$prenom = $cPrenom;
$email = $cEmail;
session_register("nom");
session_register("prenom");
session_register("email");
header("Location: session.php?" . session_name() . "=". session_id());
?>
<!-- Fichier : session.php -->
<?
session_start();
?>
<html>
<body>
<?
echo("<u>Identifiant de session :</u> <b>"
. session_id() . "</b><br>");
echo("<u>Nom de la session :</u> <b>"
. session_name() . "</b><br><br>");
echo("<u>Nom :</u> <b>". $nom . "</b><br>");
echo("<u>Prénom :</u> <b>" . $prenom . "</b><br>");
echo("<u>eMail :</u> <b>" . $email . "</b><br>");
?>
</body>
</html>
<?
session_destroy();
?>
en faite voila tout le code
$_SESSION c est comme SESSION_REGISTER
[php]<!-- Fichier : formulaire.html -->
<html>
<body>
<form method="post" action="traitement.php">
<table border="0">
<tr>
<td><u>Nom :</u></td>
<td>
<input type="text" name="cNom" size="20" value="RIVES">
</td>
</tr>
<tr>
<td><u>Prénom :</u></td>
<td>
<input type="text" name="cPrenom" size="20" value="Jean-Pierre">
</td>
</tr>
<tr>
<td><u>eMail :</u></td>
<td>
<input type="text" name="cEmail" size="20"
value="
[email protected]">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="soumettre" value="Envoyer">
</td>
</tr>
</table>
</form>
</body>
</html>
<!-- Fichier : traitement.php -->
<?
session_start();
$nom = $cNom;
$prenom = $cPrenom;
$email = $cEmail;
session_register("nom");
session_register("prenom");
session_register("email");
header("Location: session.php?" . session_name() . "=". session_id());
?>
<!-- Fichier : session.php -->
<?
session_start();
?>
<html>
<body>
<?
echo("<u>Identifiant de session :</u> <b>"
. session_id() . "</b><br>");
echo("<u>Nom de la session :</u> <b>"
. session_name() . "</b><br><br>");
echo("<u>Nom :</u> <b>". $nom . "</b><br>");
echo("<u>Prénom :</u> <b>" . $prenom . "</b><br>");
echo("<u>eMail :</u> <b>" . $email . "</b><br>");
?>
</body>
</html>
<?
session_destroy();
?>
[/php]