PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

PHP Questions Forums : Questions on Javascript AJAX JQuery

Jump to Last Post

PHP Form Validation

By: Timjohns [26-February-10 8:44AM]
25 posts
picture

Since the other thread looks at validation of data with JavaScript, what sort of validation checks should you do with PHP then?

The most important thing people always talk about is to ensure that if you are going to put the data into a database that you ensure that you format it as you want to, so for instance if you want to get rid of any formatting that you call something like strip_tags for instance.

What other checks and tips are there for validating your data to ensure that it's in the format you want it in?

Re : PHP Form Validation


Vpsingh28 [6-March-10 1:03PM]
1 posts
picture

Vh

Re : PHP Form Validation


Sallyjones [20-June-10 11:48AM]
12 posts
picture

With PHP you should check that the correct length of field is entered and that the correct type of data (alphanumeric).

Strip out any tags if you don't want them, trim to remove whitespace, check that it is safe to put in database with mysql_real_escape_string then process accordingly.

Previous: Good Uses Of AJAX
Next: Jquery - What Do You Think?



Custom Search