×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Thomas Seaford
Added: Nov 25, 2014 5:21 AM
Views: 11
'IF' structure to obtain an action value from the GET/POST array.
  1.     //Get desired action from $_GET array
  2.     if(isset($_GET['action'])){
  3.             $action = $_GET['action'];
  4.     //If the $_GET array is empty, then check the $_POST array
  5.     }else if (isset($_POST['action'])){
  6.         $action = $_POST['action'];
  7.     //If neither are set, then set to some default value
  8.     }else if (!isset($_GET['action']) && !isset($_POST['action'])){
  9.             $action = '';
  10.     }