Archive

Posts Tagged ‘php’

Validating an email address in PHP

May 13th, 2008

A small tutorial and example script to validate the format of an e-mail address. This is very useful when capturing e-mail addresses from visitors.
If you’re using the e-mail address to send out important information then it’s advisable to ask the user to enter it twice, to account for misspelling.
<?php

#email address to validate
$email = “name@domain.com”;

#validate format
if(!eregi(”^[_&a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+
(.[a-z0-9-]+)*(.[a-z]{2,4})$”, [...]

PHP/MySQL Programming , ,

Handy tip to see the PHP credits

November 7th, 2007

Ever wanted to see who was responsible for giving us the server-side scripting language, PHP? Thought so. So here’s a handy tip for displaying the names of the folks who were responsible, right from any PHP script.
To view the PHP credits simply add the following URL variable to the end of the URL of a [...]

PHP/MySQL Programming