NameSilo

PHP securitie?

Spaceship Spaceship
Watch

.jd.

Established Member
Impact
11
Right off the bat, what php security should be implemented into every script when written?

The basic security that every "new" php programmer should know..

Any help is greatly appreciated.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
This is not something that can be answered with any satisfaction to be honest. Security is dependant on what you are programming.

Some things you should do is for example if register globals is enabled reverse the functionality (even better turn it off). Ensure all user input or any input you cannot gaurantee authenitcity for that it contains exactly as expected.

Ensure any data is escaped or made safe for the ntended target (mysql_real_escape_string for mysql for example or htmlentities for browsers etc etc). Also if for example you are asking someone's age ensure that the input is an int. If it is not an int purge the data and treat it as if it has not been entered. The same goes for any data

What is also paramount is that you test and double test any code written. Try to write it in an object orientated manner. Not only does this mean that you will be able to reuse the code easily and help stop replication of the same code but will also enable you to test the code thoroughly.

Also read up on security exploits and sites regarding security. 1 good site although neglected is phpsec.org. Also there is a guy called Chris Shiflett who is a PHP advocate. He does many talks, webcasts, articles etc regarding security. Take a look at his blog at http://shiflett.org/
 
0
•••
Disable register_globals.
 
0
•••
Thanks both of you for all the help.

.jd.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Live Options
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back