ok the whole thing then..
<?
$username = $_POST['username'];
$password = $_POST['password'];
$password2 = $_POST['password2'];
$errors = 0;
$addtoerrors = 1;
if (strlen($username) > 15) {
print "Your username is too long, it can only be 15 characters. Please go back and try again.<br>";
$errors + $addtoerrors;
}
if (strlen($username) < 5) {
print "Your username is too short, it must be more then 5 characters. Please go back and try again.<br>";
if (strspn($username,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_*~")
!= strlen($username)) {
echo "Illegal character in your username. Please go back and try again.It cannot contain any symbols except for -, _, *, or ~.<br>";
}
if (strlen($password) > 15) {
print "Your password is too long, it can only be 15 characters. Please go back and try again.<br>";
}
if (strlen($username) < 5) {
print "Your password is too short, it must be more then 5 characters. Please go back and try again.<br>";
if (strspn($password,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_*~")
!= strlen($username)) {
echo "Illegal character in your password. Please go back and try again. It cannot contain any symbols except for -, _, *, or ~<br>";
}
if( $password <> $password2 )
echo "Your passwords dont match!<br>";
function plugin($email)
{
$pat1 = "@";
$emailarr = split ($pat1,$email);
$email1 = $emailarr[0];
$email2 = $emailarr[1];
$email = trim($email);
$elen = strlen($email);
//find for dot 46 ord of . =================================
$dotpresent = 0;
for ($i=2;$i<=$elen;$i++)
{
$j = substr($email,0,$i);
$jlen = strlen($j);
$lastj = substr($j,$jlen-1,$jlen);
$asci = ord($lastj);
if ($asci==46)
{
$dotpresent = 1;
}
}
//find for space 32 ord of space in between ====================
$spaceexist = 0;
for ($k=0;$k<$elen;$k++)
{
$myword = substr($email,$k,1);
if (ord($myword)==32)
{
$spaceexist = 1;
}
}
if ($email2)
{
$atpresent = 1;
}
if ($atpresent=='1' AND $dotpresent=='1' AND $spaceexist=='0')
{
$validmail = 1;
}
else
{
$validmail = 0;
}
return ($validmail);
}
$email = $_POST['email'];
$validmail = plugin($email);
//Return 1 if email is valid else 0 if mail is invalid
if (empty($email))
{
echo "Invalid email, please go back and try again.<br>";
}
else
{
echo "An activation email has been sent to $email .<br>";
}
?>
The email function im sure works because i tested it alone so hmmm... i cant find one, can u?