Advertisement
Guest User

Untitled

a guest
Mar 7th, 2012
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. <form name="input" action="Paycheck.php" method="get">
  2. Insert wage: <input type="text" name="wage" />
  3. Insert hours worked: <input type="text" name="hours" />
  4. <input type="submit" value="Calculate Salary" />
  5. </form>
  6.  
  7. <?php
  8. $hours = $_GET['hours'];
  9. $wage = $_GET['wage'];
  10. $salary = 0;
  11.  
  12. if(hours > 40)
  13. {
  14. $salary = 40 * $wage + ($hours - 40) * $wage * 1.5;
  15. }
  16. else
  17. {
  18. $salary = $hours * $wage;
  19. }
  20.  
  21. echo $salary;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement