Did I code the following functions correctly? (The first is from a code snippet)
<?php
function validate_email($email)
{
$rc1 = (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email));
$rc2 = (preg_match('/.+\.\w\w+$/',$email));
return ($rc1 && $rc2);
}
function sql_error()
{
echo '<b>MySQL Error:</b> <i>' . mysql_error() . '</i> <b>for the query:</b> <i>' . $sql . '</i>.';
}
function end_session()
{
session_destroy();
echo $logout;
}
?>