Тест - 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.



Your result can be seen below.

Result of php executing





Full code of Тест.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.         if (isset($_REQUEST['city'])) {
  16.                 $city = strip_tags($_REQUEST['age']);
  17.                 echo 'Ваш город: '.$age;
  18.         }
  19. ?>
  20.  
File Description
  • Тест
  • PHP Code
  • 25 May-2023
  • 446 Bytes
You can Share it: