stopfocus Posted January 7, 2010 Share Posted January 7, 2010 Very simple I don't see what im missing please help all the script is supposed to do is make sure that the email the some one submits has a '.' and ' @' symbol and is it the proper format but no matter what I do my function dosn't seem to operate correcrly. I have ever tried feeding a string in the proper email format dirrectly to my function to make verify the function works correctly it dosn't. Please help (running on up to date LAMP server) <form action="./validate_email.php" method="GET"> <input type="text" name="email" value="" /> <input type="text" name="emailval" value="" /> <input type="submit" name="sub" value="submit" /> </form> <?php function checkEmail($s){ $lastDot = strrpos($s,'.'); $ampersat=strrpos($s,'@'); $length=strlen($s); if (($lastDot===false) || ($ampersat===false) || ($length===false) || ($lasDot-$apmersat < 3) || ($length-$lastDot<3)) {echo"invalid";} else {echo"valid";} return $valid; } $email=$_GET['email']; $emailval=$_GET['emailval']; $mail='stop_and_focusyahoo.com'; $ok=checkEmail($mail); print"$ok </br> $mail"; ?> Link to comment https://forums.phpfreaks.com/topic/187513-confused-simple-e-mail-verification-script/ Share on other sites More sharing options...
RaythMistwalker Posted January 7, 2010 Share Posted January 7, 2010 <form action="./validate_email.php" method="GET"> Should be either <form action="../validate_email.php" method="GET"> If its in the directory below or <form action="validate_email.php" method="GET"> for the same directory. try this then see what happens. Link to comment https://forums.phpfreaks.com/topic/187513-confused-simple-e-mail-verification-script/#findComment-990072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.