?
Solved

PHP Sanitize GET

Posted on 2011-09-13
3
Medium Priority
?
251 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:tonypearce
  • 2
3 Comments
 
LVL 8

Expert Comment

by:PranjalShah
ID: 36532135
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
 

Author Comment

by:tonypearce
ID: 36532185
Kind of, what i need to do is redirect if any bad chars are detected
0
 
LVL 8

Accepted Solution

by:
PranjalShah earned 2000 total points
ID: 36532233
See the Sanitize Input section at http://www.w3schools.com/php/php_filter.asp
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to implement server side field validation and display customized error messages to the client.
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses
Course of the Month17 days, 6 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question