I can't really get my head around all the different methods of cleaning up a GET
request so I thought I would ask for some help.
$view=$_GET['view'];
if($view){
$result = mysql_query('SELECT * FROM main WHERE category = "'.$view.'"', $main);
}
Are there any security concerns here? I tried to search for examples to try and inject the string but I couldn't find anything that worked.
I was thinking of using a preg_match
with only letters and numbers but wasn't sure if it was even required.
As much as I want to know the answer, is there any background reading that I should look at to help me? There are so many different scenarios and ways to clean a string for those different situations that I'm struggling to get my head around it all.