PDA

View Full Version : urgh.



Flisker
08-12-2007, 11:19 AM
Hey,

I was browsing the forum one day and i found a nice clean() function someone made with enhanced stuff etc.. can someone find it please and i will +REP

It had SQL PHP code that it blocks :P

Thanks,
Chris

Jamieb
08-12-2007, 11:34 AM
Step 1)
Move your mouse to the search button like this..
http://img91.imageshack.us/img91/20/searchyz0.png

Step 2)
Now Press it and a box comes :O:O:O:O:O
http://img91.imageshack.us/img91/9674/search2ge9.png
Step 3)
Type in what you want.
http://img90.imageshack.us/img90/7315/search3rv9.png

Step 4)

And press go :)



Easy?

Flisker
08-12-2007, 11:36 AM
Your funny...

I already done that (or i wouldnt of posted this thread if i didnt) and cant find... :l

redtom
08-12-2007, 11:37 AM
Have you even seen the amount of results you get for it? Even using the advanced version and limit the results you have to go though pages and pages of results before you find what you want.

VistaBoy
08-12-2007, 11:40 AM
was it that one that stop using the text like UPDATE , INSERT and all that??

Flisker
08-12-2007, 11:50 AM
yea, it was VistaBoy

redtom, yes i did.

VistaBoy
08-12-2007, 11:53 AM
was it that one that stop using the text like UPDATE , INSERT and all that??
yea, it was VistaBoy
yes i was looking for that one the other day but i can not seem to find it a well :S

Flisker
08-12-2007, 11:56 AM
Its a shame i cleared my History or i would of found it

Beau
08-12-2007, 11:29 PM
You'd just need a function that ran all the input through mysql_real_escape_string. That filters out anything that may effect an SQL query.

MrCraig
08-12-2007, 11:32 PM
function clean($str)
{
$str = strip_tags(addslashes(stripslashes(htmlspecialchar s($str))));
$str = mysql_real_escape_string($str);
}


is the one i usually use.

Flisker
08-12-2007, 11:44 PM
Hmm, thanks, but I'm still in the search for the one with the MySQL stuff

Beau
08-12-2007, 11:57 PM
Hmm, thanks, but I'm still in the search for the one with the MySQL stuff

That is the MySQL stuff. Anything else is completely unnecessary.

Flisker
09-12-2007, 12:00 AM
i saw it int he thread which stopped the UPDATE tag etc

Beau
09-12-2007, 12:09 AM
But theoretically, wouldn't you be using the UPDATE statement in some of your queries? If you weren't, just don't give the MySQL user your application is running under access to that function.

mysql_real_escape_string, along with other safeguards like sprintf will prevent any SQL being run via form inputs. There isn't a need for anything else.

Flisker
09-12-2007, 12:13 AM
SQL Injections

Beau
09-12-2007, 12:15 AM
Obviously you're safeguarding against SQL injections. I wasn't expecting you to type in something like DROP database_name into your script :P

mysql_real_escape_string safeguards against SQL injections. You don't need another alternative, as it probably does exactly the same as the function you saw, if not more, with less server resources being taken up.

Flisker
09-12-2007, 12:16 AM
ok, thanks :D ill be showing the public the script i made soon :P

Want to hide these adverts? Register an account for free!