I have a lot of files which have things like
1- mysql_query("update ... $_POST['foo'] ...");
I want to transform that to this
2- $foo = mysql_real_escape_string($_POST['foo']);
3- mysql_query("update ... $foo ...");
I had the idea to open each file, select the text $_POST['foo']
(form 1-) press a key combination, and then some tool automatically:
- put on my clipboard
mysql_real_escape_string($_POST['foo']);
(for adding in 2-) - replace the text in 1- with the text in 3-
Then manually write $foo =
and press ctrl+v to generate 2-
I'm trying with notepad++ and a plugin called fingertext, and trying to make a macro, but had no success.
Any suggestion?