Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 7th, 2012  |  syntax: None  |  size: 0.42 KB  |  views: 170  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }