There are a plethora of array functions which you can read about on the php.net site:
http://www.php.net/arrayIn most scenarios one of these functions will do the job. I think here you want to use array_search:
CODE
if ( array_search($_GET['name'], $p_actions )===false) {
die('Security breach');
}
else {
...
}
Note the use of the === operator (absolute equals). The reason for this, is array_search returns the
key of the matching array element, or
false if it's not found. So if $_GET['name'] == 'login', then array_search will return 0. This is why we have to test for === false, because if the result is 0 then it is
not a security breach, but the ordinary == operator sees 0 and false as the same thing, whereas === makes the correct distinction.
Sorry, my explanation got a little long-winded then, did that all make sense?
--serializer