Lock mysql db and php pages

Hi Guys,

What do you usually do to make a mysql / php combo more secure.

- Validating the form input within the php script
- Limit the db user account to the action the script should do
- Firewall the db ports
- Use safe passwords

I am wondering if you have anything else in mind to lock the cc information in the db.
Encryption of certain db fields? How to store the keys ...

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jaime OlivaresSoftware ArchitectCommented:
Some tips:
I think a first approach to make scripts secure is to store in  SSL pages.
Other common protection is to take care about query sentences, to avoid  code injection you may use some functions as addslashes() / stripslashes() to avoid users to insert sql portions into fields.
All your pages must verify in session variables if you are correctly logged before any action.
Jaime OlivaresSoftware ArchitectCommented:
About keys, them can be stored as MD5 hashes, even you can hash keys at client side using some javascript function.
i agree with Jamie.
what I do normally is storing the password with md5.
The downside of this is we need to reset the password if the user forget.
The upside of this is, we can ensure that we do not store password at all (from the privacy point of view).

Jaime OlivaresSoftware ArchitectCommented:
>The downside of this is we need to reset the password if the user forget.
In this case you can generate a random 'temporary' password, then user will enter and change it.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:
Accept: jaime_olivares

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.