Final Question 19 pg 2 - 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 Final Question 19 pg 2.php
- <?php
- session_start(); //second page?
- ?>
- <!DOCTYPE html>
- <html>
- <body>
- <?php
- $tax = .12;
- $medicare = .062;
- $yearly_pay = 0;
- $total = 0;
- $_SESSION["name"] = $name;
- $_SESSION["rate_of_pay"] = $rate_of_pay;
- $_SESSION["hours_worked"] = $hours_worked;
- $_SESSION["relatons"] = $relatons;
- echo $name;
- echo $rate_of_pay;
- echo $hours_worked;
- $yearly_pay = $rate_of_pay * $hours_worked;
- $total = $yearly_pay * ($medicare + $tax);
- echo "Your total with deductions is $total";
- ?>
- </body>
- </html>