Reputation: 12512
If I know what vars I can have in my URL how do I validate my URL and ignore the ones that aren't on my list?
I suppose I will have all 'good' vars in an array
$good = array("name", "car", "year", "color");
Then I need to get the request URL, then break it apart looking for QUERY elements and loop those against my $good array, strip the ones that don't belong and process request. Seems like a good plan in theory. Or is there a better plan? If it's OK, how do I do all that?
$url = http://mydomain.com/?car=1&color=red&bad=asdasd
Upvotes: 1
Views: 45