FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Check if $_GET contains something other than what's allowed
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Check if $_GET contains something other than what's allowed [message #183821 is a reply to message #183820] Thu, 21 November 2013 21:31 Go to previous messageGo to previous message
Salvatore is currently offline  Salvatore
Messages: 38
Registered: September 2012
Karma:
Member
On 2013-11-21, Jason C <jwcarlton(at)gmail(dot)com> wrote:
> Just for the sake of peace of mind, how can I check for any $_GET key
> that's not allowed (in which case I can kill the script from the
> beginning)?

$allowed_values = array('username', 'password', ...);

foreach ($_GET as $key => $value) {
if (array_search($key, $allowed_values) === false) {
// deny access here
}
}

--
Blah blah bleh...
GCS/CM d(-)@>-- s+:- !a C++$ UBL++++$ L+$ W+++$ w M++ Y++ b++
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: finding newlines
Next Topic: video sharing website
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 17:38:03 GMT 2024

Total time taken to generate the page: 0.26369 seconds