Guest User

Untitled

a guest
Aug 16th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. /* Failed attempts at a validation function
  2.    function displayError($fieldName, $errormsg) {
  3.        global $errorCount;
  4.        echo "Error for \"$fieldName\": $errorMsg<br />\n";
  5.        ++$errorCount;
  6.    }
  7.    
  8.    function validateNumbers($data, $fieldName) {
  9.        global $errorCount;
  10.        if (empty($data)) {
  11.            displayError($fieldName, "This field is required");
  12.            $retval = "";
  13. echo "empty";
  14.        } else {
  15.            $retval = trim($data);
  16.            $retval = stripslashes($retval);
  17. echo "working";
  18.        }
  19.        return($retval);
  20.    }
  21.        
  22.     This was my attempt at an overtime calculation but it never worked
  23.     if ($hours > 40) {
  24.        $salary = ([$wage * 40] + [$hours - 40 * ($wage * 1.5)]);
  25.        }
  26.    */
Add Comment
Please, Sign In to add comment