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.
Result of php executing
Full code of Week 9-10 Question 5.php
- <!DOCTYPE HTML>
- <html>
- <body>
- <?php
- $name = $room = $in_name = $in_email = "";
- ?>
- <form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">
- Course Name: <input type="text" name="name" value="<?php echo $name;?>"><br>
- Room Number: <input type="text" name="room number" value="<?php echo $room;?>"><br>
- Instructors Name: <input type="text" name="instructors name" value="<?php echo $in_name;?>"><br>
- Instructors E-mail: <input type="text" name="instructors email" value="<?php echo $in_email;?>"><br>
- <input type="submit">
- </form>
- <?php
- echo "Welcome $in_name to the following Course $name, in room $room, and email $in_email";
- ?>
- </body>
- </html>