Php: Afficher une variable aprés submit
Résolu/Fermé
A voir également:
- Php: Afficher une variable aprés submit
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour à la ligne php ✓ - Forum PHP
- Php?id=1 - Forum PHP
- Retour a la ligne avec Echo comment faire ? - Forum Webmastering
1 réponse
scriptiz
Messages postés
1424
Date d'inscription
dimanche 21 décembre 2008
Statut
Membre
Dernière intervention
14 septembre 2023
425
Modifié par scriptiz le 28/11/2011 à 14:30
Modifié par scriptiz le 28/11/2011 à 14:30
<!DOCTYPE html> <html> <head> <title>New test3</title> <script type="text/javascript"> function Analys() { var Case11 = document.getElementById('Case11'); var Case11txt = Case11.options[Case11.selectedIndex].value; var Case12 = document.getElementById('Case12'); var Case12txt = Case12.options[Case12.selectedIndex].value; var Case13 = document.getElementById('Case13'); var Case13txt = Case13.options[Case13.selectedIndex].value; alert("Start JavaScript Analysis\nCase11 = " + Case11txt + "\nCase12 = " + Case12txt + "\nCase13 = " + Case13txt); return true; } </script> </head> <body> <form id="post" onsubmit="return Analys()" action="#" method="post"> <style> h1 { font-size: 30pt; } select { margin-left: 25%; font-size: 10pt; text-align: center; } .Cell { font-size: 15pt; padding: 15px; border: 2px solid black; align: center; } </style> <br> <section> <center> <div> <table> <tr> <td><div class="Cell"><h2>Source</h2></div></td> <td><div class="Cell"><h2>Case 1 1</h2> <select id="Case11" name="Case11"> <option value="drive">drive</option> <option value="choke">choke</option> <option value="AHF">AHF</option> <option value="PHF">PHF</option> </select> </div></td> <td><div class="Cell"><h2>Case 1 2</h2> <select id="Case12" name="Case12"> <option value="drive">drive</option> <option value="choke">choke</option> <option value="AHF">AHF</option> <option value="PHF">PHF</option> </select> </div></td> <td><div class="Cell"><h2>Case 1 3</h2> <select id="Case13" name="Case13"> <option value="drive">drive</option> <option value="choke">choke</option> <option value="AHF">AHF</option> <option value="PHF">PHF</option> </select> </div></td> </tr> </table> </div> <br> <input type="submit" value="Start Analysis" name="fonction"/> </center> </section> </form> <?php if (!empty($_POST['Case11']) && !empty($_POST['Case12']) && !empty($_POST['Case13'])) { echo '<h3>Données récupérées du formulaire :</h3>'; echo '<p>'; echo 'Valeur de Case11 : '.$_POST['Case11'].'<br />'; echo 'Valeur de Case12 : '.$_POST['Case12'].'<br />'; echo 'Valeur de Case13 : '.$_POST['Case13'].'<br />'; echo '</p>'; } ?> </body> </html>
"The most successful method of programming is to begin a program as simply as possible, test it, and then add to the program until it performs the required job." -- PDP8 handbook, Pg 9-64
28 nov. 2011 à 14:38
Merci beaucoup !!!!!
30 nov. 2011 à 14:56
1 déc. 2011 à 07:44
merci d'avance !
En tout cas vous êtes géniaux les gars de CCM !