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.
Using Windows message as a Handle
Hi,
Join Query Help
Hi all,I am having problems with the below code, which we shall call 'my first join query'! Suprise suprise its not working and I am getting an error I have not seen before:QuoteParse error: parse
Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with.I found this incomplete source code, and I wanted to finish it, but I have no idea what I am
Strange cookie problem. setcookie dependant on where user was directed from?
Hello,I have a website that sets a cookie when a user visits the website. The cookie holds an ID number that I have decided to refer to Computer Identification Number (CIN) that is unique for every
How can I get my program to read a larger array ??
Hi:
imap: how to save a copy of sent emails to sent elements
Hello my friends,I am writing an online emailing application with inbox outbox/sent elements etc.When I send and email with mail() function, what would I do in order to save to the sent
Multithreading in Oracle (Java, SQLJ, Pro*C,??) on 10g
I am investigating how to run a Java stored procedure in multithread mode.I know that if I change the program to be multithreaded, the Database runs it fine, but it will not show any concurrency
Not adding to db
Hi, I can't figure out why it won't add the record to the database. It's just a simple form to get name and email but when I hit submit I get the "or die" message. Code: $Fname =
extending tidy
I have problem with type-hinting and extending tidy. This code creates error:Code: class cMyTidy extends tidy{ public $tralala;}$oMyTidy = new cMyTidy();doSomething($oMyTidy);function
Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter seems incredibly boring, daunting and complicated, it looks so awful that I haven't yet read it so I