Задача №3 Скрываем форму после отправки - PHP Online

Form of PHP Sandbox

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.

Name: Задача №3 Скрываем форму после отправки fullscreencopydownloadembedprint


Your result can be seen below.

Result of php executing





Full code of Задача №3 Скрываем форму после отправки.php

  1. <?php
  2.  //Если город пустой - покажем форму
  3.  if (isset($_REQUEST['city'])) {
  4. ?>     
  5.     <form action="" method="GET">
  6.         <input type="text" name="name">
  7.         <input type="submit">
  8.         </form>
  9. <?php
  10.  }
  11.  ?>
  12.  
  13.  <?php
  14.    //Если форма Была отправлена и город 
  15.    не пустой:
  16.        if (isset (&_REQUEST['city'])) {
  17.            $citu = strip_tags($_REQUEST['age'
  18.            ])
  19.     echo 'Ваш город: '.$age;
  20.        }
  21.      ?>
File Description
  • Задача №3 Скрываем форму после отправки
  • PHP Code
  • 16 May-2022
  • 498 Bytes
You can Share it: