Jump to content

[SOLVED] Question


adam291086

Recommended Posts

Hello. I have a very simple CMS that allows the users to upload, edit and delete page content. All these function are in an admin section which has a authentication part using Cookies. The question is do i need to add in validation checks on the information being sent to prevent people dumping my whole database. This is becase only trusted users will be using the site.

 

My gut feeling is going to be yes just in case but i have no idea how to do this, any push in the right direction is much appreciated.

Link to comment
Share on other sites

Anytime any data is entered into your database, you need to validate it for the type of data you are expecting.

 

It doesn't have to be malicious to be bad, it can be just the wrong type of data as well.

 

Garbage in, garbage out.

Link to comment
Share on other sites

What if one of your trusted users gets a keylogging virus and then someone gains access to your site?

 

Regardless of if you'd get hacked or not, don't put yourself in a spot where your database can either get xss attacks or just bad data.

 

Get in the habit of doing it right the first time so you don't have to go back later and fix it all.

Link to comment
Share on other sites

Search on these PHP/MySQL keywords:

 

mysql_real_escape_string

stripslashes

trim

 

You'll also want to validate for correct data type like INT, NOT NULL or EMPTY, length of the data if there a mins/max sizes, etc.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.