sql - PHP GET must be filtered? -


i have page variables grabbed url via $_get['page'].

the question have is, due page setup, necessary filter variable if being used php switch grab page? example:

define('tab_id', 1100); define('page_id', 5005); define('title','goodies'); define('main',true); require_once "global.php";  if(!logged_in) {     header("location: ".www."/");     exit; }  if(!isset($_get['page'])){     $page = "badges"; } else {      $page = clean($_get['page']); }  $core->header(1); $core->header(2);  include(templates.'/generic-top.php');  switch($page){     default:     case "badges": {         include(templates.'/goodies/badges.php');                } }  include(templates.'/footer.php'); 

i have function named clean() used clean variable exploits, because variable not being used in queries of kind, switch(), necessary?

i'm not having problems current setup, i'm curious.

thank in advance!

nope. in fact, sanitising harmful, if happen have "page" has apostrophe in it, or whatever clean function affects (your switch fail)

what have here whitelist. haven't explicitly defined rejected.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -