221 - 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 221.php

  1. <?php
  2.     $page=$_GET['page'];
  3.     if(isset($page)){
  4.         switch($page){
  5.             case 1:// show general information
  6.             include 'about.htm!';
  7.             break ;.
  8.             case 2: // show latest headlines
  9.             include 'news.html';
  10.             break ;.
  11.             case 3:// show links to other sites
  12.             include 'links.html';
  13.             break ;.
  14.         default:// show error message
  15.         echo 'No such content section. Bad URL!';
  16.             
  17.         }
  18.        } else {// show home if no page parameter in URL
  19.         include home.html;
  20.         }
  21. ?>
  22.  
File Description
  • 221
  • PHP Code
  • 27 Apr-2024
  • 587 Bytes
You can Share it: