Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //main.php
- <?php
- $br = '<br>';
- $content = '<h3>Inscription</h3>';
- $type = "button";
- $form = '<form method="post" action="script.php">';
- $buttonOne = '<input type="submit" name="afficher" value="afficher">';
- $buttonTwo = '<input type="submit" name="affichertab" value="affichertab">';
- $nom = 'Votre nom: <input type="text" name="nom">';
- $prenom = 'Votre prénom : <input type="text" name="prenom">';
- $genres = '';
- for ($i=0; $i < 2; $i++) {
- if ($i == 0) {
- $genres = $genres . '<input type="radio" name="genre" value="H" checked>Homme';
- }
- else {
- $genres = $genres . '<input type="radio" name="genre" value="F" >femme <br>';
- }
- }
- $list = 'Pays <select name="pays">';
- $checkBoxes = 'connaissance en informatique : <br>';
- for ($i=0; $i < 3; $i++) {
- if ($i == 0) {
- $list = $list . '<option value="tun">tunisie </option>';
- $checkBoxes = $checkBoxes . '<input type="checkbox" name="pro" value="PRO"> programmation <br>';
- }
- elseif ($i == 1) {
- $list = $list . '<option value="alg">algerie </option>';
- $checkBoxes = $checkBoxes . '<input type="checkbox" name="sys" value="SYS"> systeme <br>';
- }
- else {
- $list = $list . '<option value="mar">maroc </option> </select>';
- $checkBoxes = $checkBoxes . '<input type="checkbox" name="res" value="RES"> reseaux <br>';
- }
- }
- $endForm = '</form>';
- $content = $content . $form . $br . $nom . $prenom .
- $br . $genres . $list . $br . $checkBoxes .
- $br. $buttonOne . $br . $buttonTwo . $endForm;
- echo $content;
- ?>
- //script.php
- <?php
- if (isset($_POST["nom"]))
- {
- $nom=$_POST["nom"];
- }
- if (isset($_POST["prenom"]))
- {
- $prenom=$_POST["prenom"];
- }
- if (isset($_POST["genre"]))
- {
- $genre=$_POST["genre"][0];
- }
- if (isset($_POST["pays"]))
- {
- $pays=$_POST["pays"][0];
- }
- if (isset($_POST["pro"]))
- {
- $pro=$_POST["pro"];
- }
- if (isset($_POST["sys"]))
- {
- $sys=$_POST["sys"];
- }
- if (isset($_POST["res"]))
- {
- $res=$_POST["res"];
- }
- echo " votre nom est ".$nom.
- "<br> votre prenom est: ".$prenom.
- "<br> votre genre est: ".$genre.
- "<br> votre pays est: ".$pays.
- "<br> vos connaissances sont :<br>";
- if (isset($_POST["pro"]))
- {
- echo $pro."<br>";
- }
- if (isset($_POST["sys"]))
- {
- echo $sys."<br>";
- }
- if (isset($_POST["res"]))
- {
- echo $res."<br>";
- }
- echo "
- <table border='1'>
- <tr>
- <td>nom</td>
- <td>"."$nom"."</td>
- </tr>
- <tr>
- <td>prenom</td>
- <td>"."$prenom"."</td>
- </tr>
- <tr>
- <td>sexe</td>
- <td>"."$genre"."</td>
- </tr>
- <tr>
- <td>pays</td>
- <td>"."$pays"."</td>
- </tr>
- <tr>
- <td>pays</td>
- <td>"."$sys"."</td>
- </tr>
- </table>
- ";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement