case isset($_REQUEST['btnCancel']): header("Location: ?action=employeeList"); break; case isset($_REQUEST['btnDelete']): deleteEmployee($_REQUEST['empID']); header("Location: ?action=employeeList"); break; case isset($_REQUEST['btnTrips']): header("Location: ?action=tripList&employeeId=" . $_REQUEST['empID']); break; BIG IMPORTANT NOTE Don’t include blank lines at the beginning or end of include files. These can cause problems when you transfer PHP pages to an actual server. See PHP Journal Basic Function Definitions Create: function funcName($parm1, $parm2 ...) { calcTotalOunces( ) extract here return $value; }//end function statement is optional Create return Some functions do things, but don’t return a value convertToOunces($lb) Parameters ($parm1, $parm2, etc) are also optional Unlike some languages, you cannot overload function names (same name, different parameters) Arrays and Functions FYI In PHP (unlike most other languages), arrays can be sent to or returned from functions like any other type of variable. Can be passed as parameter either by value or by reference Can be returned from a function via return statement
case isset($_REQUEST['btnCancel']): header("Location: ?action=employeeList"); break; case isset($_REQUEST['btnDelete']): deleteEmployee($_REQUEST['empID']); header("Location: ?action=employeeList"); break; case isset($_REQUEST['btnTrips']): header("Location: ?action=tripList&employeeId=" . $_REQUEST['empID']); break; BIG IMPORTANT NOTE Don’t include blank lines at the beginning or end of include files. These can cause problems when you transfer PHP pages to an actual server. See PHP Journal Basic Function Definitions function funcName($parm1, $parm2 ...) { return $value; }//end function return statement is optional Some functions do things, but don’t return a value Parameters ($parm1, $parm2, etc) are also optional Unlike some languages, you cannot overload function names (same name, different parameters) Create: calcTotalOunces( ) extract here Create convertToOunces($lb) Arrays and Functions In PHP (unlike most other languages), arrays can be sent to or returned from functions like any other type of variable. Can be passed as parameter either by value or by reference Can be returned from a function via return statement FYI