im cleaning up an old app that I wrote fixing some of the vulernabilities from attacks.
I have roughly 30 files. I want to be able to edit every $_POST and $_GET
Code: $value=$_POST['value'];
$value=$_GET['value'];
my instinct would be to edit every file and do it manually
Code: $value=$_POST['value'];
$value=mysql_real_escape_string($value)
$value=$_GET['value'];
$value=mysql_real_escape_string($value)
but if there was a faster way it would make my life easier. What I would like to do is to maybe create a function i can put at the top of every page or into my global.php which is included into every page that would do something like this
Code:
if (get_magic_quotes_gpc()) {
$value = stripslashes($value);
}else{
$value=mysql_real_escape_string($value)
}
i dont intend to have magic quotes on, but other people might on there servers.
I just need every $_POST or $_GET within my script to be automaticly cleaned or filtered from SQL Injections
I saw something a long time ago where it was something they put at the top of there page, this will be completely wrong, but i will give u an example of what it looked like
Code: $_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
$_REQUEST = array_map('mysql_real_escape_string', $_REQUEST);
im not to sure how that goes about effecting everything, where to put it, etc
Any ideas or suggestions? Or am I stuck doing it manually.
How to have a log of all the status a VIM document had been ?
Hi guys,
isset undefined variable
Hi all,Hope someone can point out the obvious. I've a log in script, if you dont enter a username or pw, you get a red asterix show by the field and a pop up.If you enter an email but not the pw, it
having a small php error tha deals with the 'foreach'
Last night i was working on a script for a cart and it seemed to working good, until this morning. For some reason i'ts giving me the following error:Warning: Invalid argument supplied for foreach()
Strange
I recently noticed some odd HTML appear in some of the websites I host. Not all of them are run on a CMS but the majority (but not all) are running through the same FTP account.I've searched
User information
Hi All,
natcasesort works on one server but not on another
HiI have a problem that I was hoping that someone can help me with.I'm trying to use natcasesort() to sort an array. This works fine on my laptop (which I use for testing and which uses php 5.2.6),
Any decent php formatter/beautifier/pretty printer?
Any decent php formatter/beautifier/pretty printer class/function?I found the following whilst
php include email form with attachment
I have had no luck with finding a email form all over the Internet for various reasons. Some insecure, some simple, some lack of attachment capability, some use redirect, etc. How does one find the
Is there a function ... auto send IP
Is there some function that can be sent to a ddns service that returns the ip address of a ddns forward. I am working on a script that uses a dvr from a home and the owner wants to have the dvr stream
Remove values in array2 from array1
I have two arrays.Array 1 is where the array key holds various different numbers. For example:Code: [Select]$array[32] = 1;$array[122] = 1;$array[238] = 1;$array[324] = 1;The other array holds values