PHP Sanitize GET

Hi,
I would like a block of PHP in the header of a page that recieves the input via a GET url string, I want to stop any encoded rubbish and forward to a page where I can give instructions.

Thanks
Tony PearceAsked:
Who is Participating?
 
PranjalShahConnect With a Mentor Commented:
See the Sanitize Input section at http://www.w3schools.com/php/php_filter.asp
0
 
PranjalShahCommented:
I think you want to redirect to a particular page if you receive an input via url, you can do

if($_GET['urlvariable']){
        header ('Location: ' . "http://mysite.com");
}
0
 
Tony PearceAuthor Commented:
Kind of, what i need to do is redirect if any bad chars are detected
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.