Jump to content

SQL Injection!


Masna

Recommended Posts

Hey all! I'm currently working on a website that involves money, hopefully lots. Anyway, I NEED to protect against hackers in anyway I can, so I was wondering about...SQL Injection. How can one make SQL injections to a MySQL database, and how can I prevent it? Thanks in advance.
Link to comment
https://forums.phpfreaks.com/topic/4269-sql-injection/
Share on other sites

Escape everything you put into a query by using mysql_real_escape_string which will put slashes before quotation marks. Then when you want to use it later stripslashes it. You can read more about both those at PHP.net though I think it's fairly straightforward. Oh last thing, mysql_real_escape_string requires a database connection, just fyi.
[!--quoteo(post=352303:date=Mar 6 2006, 06:10 PM:name=Buyocat)--][div class=\'quotetop\']QUOTE(Buyocat @ Mar 6 2006, 06:10 PM) [snapback]352303[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Ken, that's strange because I was justing using something and had to strip slash it in order to get rid of the slashes... wonder what is different between our systems.
[/quote]

Check get_magic_quotes_gpc() ... It may be on for you, but off for Masna.. That would explain it. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.