Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Developer Drive:
PHP Error Checking
Jul 31, 2012 @ 17:58:49

The Developer Drive site has a new post with a few beginner suggestions about how to do some error reporting in your applications:

As much as programmers attempt to anticipate every possible action or combination of actions that a user can take when encountering a web application, no one can foresee them all. When the user takes an unanticipated course of action and "breaks" the application, the software needs to catch them before they fall.

They show you a few methods for handling the errors that might come up including the die function, exception handling, triggering errors and just outputting errors via an "echo" or "print" (or something similar).

tagged: error handling checking exception trigger die

Link:

WebProNews.com:
Form Checking - Verifying Name Using PHP Ereg
Jun 23, 2006 @ 12:40:01

On WebProNews.com, there's a brief tutorial on using regular expressions, specifically for filtering "names" entered by users.

One important use of Regular Expressions (Regex) is to verify fields submitted via a form. In this article, we attempt to write an expression that is able to verify the user's first name, middle name, last name or just names in general.

The expression should allow names such as "Mary", "Mr. James Smith" and "Mrs O'Shea" for example. So the challenge here is to allow spaces, periods and single quotation marks in the name field and reject any other characters.

Their examples use the preg_* functions in PHP to work, first looking for any invalid characters in the string(s), then amending it to ensure that there aren't any numbers involved either. The few lines of code it takes are included as well.

tagged: regular expression form checking verify preg regular expression form checking verify preg

Link:

WebProNews.com:
Form Checking - Verifying Name Using PHP Ereg
Jun 23, 2006 @ 12:40:01

On WebProNews.com, there's a brief tutorial on using regular expressions, specifically for filtering "names" entered by users.

One important use of Regular Expressions (Regex) is to verify fields submitted via a form. In this article, we attempt to write an expression that is able to verify the user's first name, middle name, last name or just names in general.

The expression should allow names such as "Mary", "Mr. James Smith" and "Mrs O'Shea" for example. So the challenge here is to allow spaces, periods and single quotation marks in the name field and reject any other characters.

Their examples use the preg_* functions in PHP to work, first looking for any invalid characters in the string(s), then amending it to ensure that there aren't any numbers involved either. The few lines of code it takes are included as well.

tagged: regular expression form checking verify preg regular expression form checking verify preg

Link:


Trending Topics: