Board index   FAQ   Search  
Register  Login
Board index php forum :: PHP and MySQL Security PHP & MySQL Security

validation to insert data into DB

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: macek, egami, gesf

validation to insert data into DB

Postby beginner2php » Fri Aug 10, 2012 2:34 pm

Hi,

Actually I'm confused a little between usage of client side and server side validation. Do i use client side validation to check if a required field is left blank or of a valid format then use server side validation to escape special characters then inserting into the database?

if that's the case, what if i wanna insert an email into a database, and javascript validation passed and it's a valid email, should i use a further server side validation? real escape characters or filter_var to check again if it's valid?or simply i get the value in the text field and process to the database once it passed the client side validation?

Thx
beginner2php
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Aug 10, 2012 2:18 pm

Re: validation to insert data into DB

Postby johnj » Sun Aug 12, 2012 5:56 am

Honestly you should use both. Client side validations are there to help a genuine user to enter the right data. Server side validations are mostly there to protect the server from malicious users.

...what if i wanna insert an email into a database, and javascript validation passed and it's a valid email, should i use a further server side validation?...

YES. if it passed js validation that means we have helped the user to enter the right data. We still need server side validations to protect the server/application from malicious users.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1465
Joined: Thu Mar 10, 2011 5:07 pm

Watch Montblanc

Postby mrewster » Sat Sep 22, 2012 2:01 pm

Was told to see neurologist. Had MRI, MRA, of head and neck. Nothing. It getting easier and easier to do shopping. It has been a long time since we were need to leave our homes to buy something we want or need. Now to purchase almost any item we desire we just have to enter the Internet Mont Blanc Meisterstuck Ballpoint, do several clicks and wait for the delivery..
The recent expo of Indianapolis, Ind. is once again packed with swarming people when it showcased its greatest powersports accessories. Although dealers' number is a little bit lesser this year Mont Blanc Pen Repairs, the 2012 Indianapolis Dealer Expo showcased a new line up of ATV and UTV products beyond what was expected previously.
You can choose GoAir service to fly anywhere in India. You can avail air service of the airline simply by logging on to the official website of the airline. If you have any query Montblanc Fountain, comment or suggestion, contact customer care number..
Bring clothes and accessories that are multi use and that can dry quickly. And instead of bringing more clothes, consider washing more frequently as this method would help you travel with less stuff. This would also help if you have to walk up the stairs of hotel or hostel with no lifts.
There is no need for you to spend big money on computer accessories Montblanc Buy, enhancements Mont Blanc Fountain Pen, and special ambient lighting. These are non-essential things and you will just waste money on them. Instead of buying enhancements, you can simply download free desktop clock wallpaper.
The Patriot inside me applauds our Active Duty members, our Guardsmen and our Reservists all over the world. They are fighting a new type of fight and will prevail I am certain. From O-10 down to E-1 they are by far the best trained and best equipped military to deal with the threats to our nation.
mrewster
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Jul 25, 2012 7:00 am


Return to PHP & MySQL Security

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.