| // http://scriptdemo.blogspot.ca // a simple way to check whether an email address is valid function CheckEmail($str) { $str=str_replace('#','@',$str); if (preg_match("/^[a-zA-Z]+([\._][a-zA-Z0-9]+)*@([a-zA-Z0-9]+\.)+[a-zA-Z]{2,4}$/",$str)) { return TRUE; } else { return FALSE; } } |
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Tuesday, May 22, 2012
[php] email validation function
Labels:
email,
function,
php,
validation
Wednesday, June 2, 2010
open sql database with php
| <?php // general information $host="hostname"; $username="username"; $password="sqlpassword"; $db_name="databasename"; // connect to mysql mysql_connect("$host","$username","$password") or die ("failed to connect server"); mysql_select_db("$db_name") or die ("failed to select db"); ?> |
Subscribe to:
Posts (Atom)