Jump to content

PHP Security


sh0wtym3

Recommended Posts

My website was recently hacked, so I learned the hard way that you can't leave PHP vulnerability issues on the backburner.

 

I've been reading up on PHP security (here on phpfreaks.com actually), and I need to "clean" any data being sent to my server, before it is sent. What would be the best way (or combination of ways) to accomplish this?

 

There's mysql_real_escape_string to escape form data

 

There's strip_tags to remove <> tags and anything inside them

 

There's eregi to only allow certain characters

 

Should I use all of these together, and is there any useful functions I might be missing?

Link to comment
https://forums.phpfreaks.com/topic/152327-php-security/
Share on other sites

you need to valadate all posting information, to a database with,

 

preg_match or preg_match_all

 

you also need to protect the database with mysql_real_escape_string() that it.

 

unless it a distribution project.

 

then you use more validation functions

 

the more you validate information the less your get hacked.

Link to comment
https://forums.phpfreaks.com/topic/152327-php-security/#findComment-799988
Share on other sites

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.