Connecting Tech Pros Worldwide Forums | Help | Site Map

Validate phone number/std code before adding to database

Newbie
 
Join Date: Feb 2008
Posts: 6
#1: Mar 26 '08
hi...


I have created a form it's working properly.... but i want to consider phone number and STD code in two different text field for a single lable phone number.....

and I have considered the fields like first name,last name,Date of birth, Phone Number ,mobile number and address...

1)If i enter all the fields then only the values should enter into the database...
2) if i dint enter the mobile field then also it should save into the database.
3) If i dint enter the phone number field then the values should not enter into the database..

please reply me as soon as possible

thanks in advance

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jun 29 '08

re: Validate phone number/std code before adding to database


The idea is simple. Validate your data before adding to the database. All you need to check in this case besides security/sanitation checks is that the phone number has been entered. If it hasn't, then display an error message.
Reply