Formulaire PHP [EXO(9)] - PHP Online
Form of PHP Sandbox
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of Formulaire PHP [EXO(9)].php
- BIENVENUE au FORMULAIRE PHP (exo9) <br>
- Veuillez entrer les prix et le nombre :
- <form method ="POST" action="Calcul.php">
- Prix de la table : <input type="number" name="prixtable" required><br>
- Prix de l´armoire :<input type="number" name= "prixarmoire"requires><br>
- Nombre: <input type="number " name="nombre" required><br>
- <input type ="submit" value="Calculer le total" >
- </form>
- <?php
- // en entrant les données dans le formulaire on les envoies dans le fichier calcul.php afin d´etre traitées.
- if (isset($_SERVER["REQUEST_METHOD"]) && $_SERVER["REQUEST_METHOD"] == "POST") {
- $prix_table = $_POST["prixtable"];
- $prix_armoire = $_POST["prixarmoire"];
- $nombre = $_POST["nombre"];
- echo "Prix de la table: " . $prix_table . "<br>";
- echo "Prix de l'armoire: " . $prix_armoire . "<br>";
- echo "Nombre: " . $nombre . "<br>";
- // Calculer le total
- $Prix_total = $prix_table * $prix_armoire * $nombre;;
- // Afficher le total
- echo "Le total est : " . $Prix_total . "€";
- }
- ?>
- BIENVENUE AU FORMULAIRE de l´exo10:<br>
- Veuillez entrer vos données: