Solved

PHP Sanitize GET

Posted on 2011-09-13
3
193 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 500 total points
ID: 36532233
See the Sanitize Input section at http://www.w3schools.com/php/php_filter.asp
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now