Portal Home > Knowledgebase > Articles Database > Help with validating a form


Help with validating a form




Posted by rynet91, 08-20-2008, 06:29 PM
I am building a PHP script and it requires the user to login. I noticed after reading up on security about these scripts, the best thing you can do is validate your database line so that the user must enter a username and password or it would not send the data. Can someone with PHP experience help me validate this form of mine. Here is my code to check the data to see if it matches in the database:

Posted by The Universes, 08-20-2008, 08:03 PM
First of all, you need to sanitize the input. http://php.net/mysql_real_escape_string You can use regex (preg_match) to check that they actually entered a "valid" email.

Posted by david510, 08-20-2008, 08:07 PM
Can you paste here the desc details of the tables users ?



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
array file sorting (Views: 607)