Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form name="input" action="Paycheck.php" method="get">
- Insert wage: <input type="text" name="wage" />
- Insert hours worked: <input type="text" name="hours" />
- <input type="submit" value="Calculate Salary" />
- </form>
- <?php
- $hours = $_GET['hours'];
- $wage = $_GET['wage'];
- $salary = 0;
- if(hours > 40)
- {
- $salary = 40 * $wage + ($hours - 40) * $wage * 1.5;
- }
- else
- {
- $salary = $hours * $wage;
- }
- echo $salary;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement