Week 9-10 Question 5 - 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 Week 9-10 Question 5.php

  1. <!DOCTYPE HTML>
  2. <html>  
  3. <body>
  4. <?php
  5. $name = $room = $in_name = $in_email = "";
  6. ?>
  7. <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
  8. Course Name: <input type="text" name="name" value="<?php echo $name;?>"><br>
  9. Room Number: <input type="text" name="room number" value="<?php echo $room;?>"><br>
  10. Instructors Name: <input type="text" name="instructors name" value="<?php echo $in_name;?>"><br>
  11. Instructors E-mail: <input type="text" name="instructors email" value="<?php echo $in_email;?>"><br>
  12. <input type="submit">
  13. </form>
  14. <?php
  15. echo "Welcome $in_name to the following Course $name, in room $room, and email $in_email";
  16. ?>
  17. </body>
  18. </html>
File Description
  • Week 9-10 Question 5
  • PHP Code
  • 07 Apr-2021
  • 688 Bytes
You can Share it: