Best way to add validation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
arpowers
Forum Commoner
Posts: 76
Joined: Sun Oct 14, 2007 10:05 pm
Location: san diego, ca

Best way to add validation

Post by arpowers »

Hey guys,
I need to add all the validation functionality to my site...

what is the best way to accomplish this? By that I mean, should I use a pre-packed solution and if so, which one?

\Best\

Andrew
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

If you're already going with an existing solution, I doubt there's just a third party validating solution that can easily be tied in.

Here's what you need to look for, or implement yourself

1. Checking for magic_quotes_gpc
2. If you're expecting a certain result, make sure your data is one of the ones you're expecting.
3. Analyze input data by making sure it looks like what you want.. eg. is_int(), is_numeric() and perhaps use type casting to make it want you want
4. If entering into a database, always escape the string, to prevent sql injection

are the basics
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

staar2
Forum Commoner
Posts: 83
Joined: Fri Apr 06, 2007 2:57 am

Post by staar2 »

Post Reply