Sorgu dizeleri temizleme en iyi yöntemi nedir?

0 Cevap php

Ne iyi ve $page ve $getVars, temiz ve güvenli olmasını sağlamak yöntemi?

//fetch the passed request
$request = $_SERVER['QUERY_STRING'];

//parse the page request and other GET variables
$parsed = explode('&', $request);

//the page is the first element
$page = array_shift($parsed);

//the rest of the array are GET statements, parse them out;
$getVars = array();
foreach($parsed as $argument)
{
  //split GET vars along '=' symbol to seperate the variable and its value
  list($variable, $value) = explode('=', $argument);
  $getVars[$variable] = $value;
}

0 Cevap