<html>
<head><title>email validation test</title></head>
<body>
<?php 
require getcwd() . "/email-validation.inc";
$test_add = array("*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**", "*****@*****.**", "wrong-address-with@@@@-remove_me-and-some-i-hate_SPAM-stuff");
while (list(, $v) = each($test_add)) {
    echo "The address: {$v} (" . clean_AntiSpam($v) . ") is";
    if (!is_emailable_address(clean_AntiSPAM($v))) {
        echo " not";
    }
    echo " valid\n<br>";
}
?>
<hr>
The jesusmc@scripps.edu, jmcastagnetto@yahoo.com and jcastagnetto@yahoo.com 
should validate OK as of 2001-02-28 --- JMC
</body>
</html>
Example #2
0
$vars = array('type', 'country', 'category', 'email', 'url', 'ldesc', 'sdesc');
foreach ($vars as $varname) {
    if (!isset($_POST[$varname])) {
        $_POST[$varname] = "";
    }
}
// We need to process some form data
if ($process) {
    // Clean up magic quotes, if they were inserted
    if ($MQ) {
        foreach ($_POST as $k => $v) {
            $_POST[$k] = stripslashes($v);
        }
    }
    // Clean and validate data
    if (!is_emailable_address($_POST['email'])) {
        $errors[] = 'You must supply a valid email address.';
    }
    /**
     * Lockout of addresses and domains known to SPAM us.
     * Add, edit, or remove blacklisted users or domains
     * in include/email-validation.inc :: blacklisted().
     */
    $uemail = isset($_POST['email']) ? strtolower($_POST['email']) : '';
    if (blacklisted($uemail)) {
        $errors[] = 'An expected error has been encountered.  Please don\'t try again later.';
    }
    $_POST['sdesc'] = trim($_POST['sdesc']);
    if (!$_POST['sdesc']) {
        $errors[] = "You must supply a short description of the event.";
    }
Example #3
0
 // Check for errors
 if (empty($_POST['id'])) {
     $error .= "You must supply a desired Git user id. <br>";
 } elseif (!preg_match('!^[a-z]\\w+$!', $_POST['id'])) {
     $error .= "Your user id must be >1 char long, start with " . "a letter and contain nothing but a-z, 0-9, and _ <br>";
 }
 if (empty($_POST['fullname'])) {
     $error .= "You must supply your real name. <br>";
 }
 if (empty($_POST['realpurpose'])) {
     $error .= "You must supply a reason for requesting the Git account. <br>";
 }
 if (empty($_POST['password'])) {
     $error .= "You must supply a desired password. <br>";
 }
 if (empty($_POST['email']) || !is_emailable_address($cleaned['email'])) {
     $error .= "You must supply a proper email address. <br>";
 }
 if (empty($_POST['yesno']) || $_POST['yesno'] != 'yes') {
     $error .= "You did not fill the form out correctly. <br>";
 }
 if (empty($_POST['group']) || $_POST['group'] === 'none' || !isset($groups[$_POST['group']])) {
     $error .= "You did not fill out where to send the request. <br>";
 }
 if (!isset($_POST['guidelines']) || !$_POST['guidelines']) {
     $error .= "You did not agree to follow the contribution guidelines. <br>";
 }
 // Post the request if there is no error
 if (!$error) {
     $error = posttohost("http://master.php.net/entry/svn-account.php", array("username" => $cleaned['id'], "name" => $cleaned['fullname'], "email" => $cleaned['email'], "passwd" => $cleaned['password'], "note" => $cleaned['realpurpose'], "yesno" => $cleaned['yesno'], "group" => $cleaned['group']));
     // Error while posting
Example #4
0
     $reject_text .= "for those purposes. This was clearly stated in the page\n";
     $reject_text .= "you used to submit your note, please carefully re-read\n";
     $reject_text .= "those instructions before submitting future contributions.\n\n";
     $reject_text .= "Bug Submissions should be entered at <http://bugs.php.net/>\n";
     $reject_text .= "Feature Requests should also be entered at <http://bugs.php.net/>\n";
     $reject_text .= "Support and ways to find answers to your guestions can be found\n";
     $reject_text .= "at <http://gtk.php.net/resources.php>\n\n";
     $reject_text .= "Your note has been removed from the on-line manual.\n\n";
     $query = 'SELECT *,UNIX_TIMESTAMP(ts) AS xwhen FROM note WHERE id=' . $id;
     if ($result = mysql_query($query)) {
         $row = mysql_fetch_array($result);
         // email the submitter if the address looks reasonable
         // uses functions in include/email-validation.inc
         $submitter = clean_AntiSPAM($row['user']);
         echo "<p>Note " . $row['id'] . " by: " . $row['user'] . " ({$submitter}) ";
         if (is_emailable_address($submitter)) {
             mail($submitter, "note " . $row['id'] . " rejected and deleted from " . $row['sect'] . " by notes editor {$user}", $reject_text . "----- Copy of your note below -----\n\n" . stripslashes($row['note']), "From: " . $user . "@php.net");
         }
         // email to the list
         mail($mailto, "note " . $row['id'] . " rejected and deleted from " . $row['sect'] . " by {$user}", stripslashes($row['note']), "From: " . $user . "@php.net");
         $query = 'DELETE FROM note WHERE id=' . $id;
         if (mysql_query($query)) {
             echo '<b>rejected and deleted.</b></p>';
         }
         if ($popup) {
             echo '<script language="javascript">window.close();</script>';
         }
     }
     break;
 case 'edit':
     echo "<p>Only people with " . make_link('http://www.php.net/cvs-php.php', 'CVS accounts') . " are able to edit the manual notes, so please don't email us asking why this doesn't work for you.</p>";
 <li><a href="http://lists.phpbar.de/mailman/listinfo">German Mailing List</a></li>
 <li><a href="http://groups.google.com/group/de.comp.lang.php.misc/topics">German Newsgroup</a> (also other topics under de.comp.lang.php)</li>
 <li><a href="http://groups.yahoo.com/group/php_greek/">Greek Mailing List</a></li>
 <li><a href="http://weblabor.hu/levlistak">Hungarian Mailing List</a></li>
 <li><a href="http://www.domeus.it/circles/php">Italian Mailing List (at PHPItalia)</a></li>
 <li><a href="http://ml.php.gr.jp/">The Japanese PHP User Group\'s Mailing lists</a></li>
 <li><a href="http://br.groups.yahoo.com/group/php-pt/">Portuguese Mailing List</a></li>
</ul>
';
site_header("Mailing Lists", array("current" => "help"));
// Some mailing list is selected for [un]subscription
if (isset($_POST['maillist'])) {
    // No error found yet
    $error = "";
    // Check email address
    if (empty($_POST['email']) || $_POST['email'] == '*****@*****.**' || $_POST['email'] == '*****@*****.**' || !is_emailable_address($_POST['email'])) {
        $error = "You forgot to specify an email address to be added to the list, or specified an invalid address." . "<br>Please go back and try again.";
    } else {
        // Decide on request mode, email address part and IP address
        $request = strtolower($_POST['action']);
        if ($request != "subscribe" && $request != "unsubscribe") {
            $request = "subscribe";
        }
        $sub = str_replace("@", "=", $_POST['email']);
        $remote_addr = i2c_realip();
        // Get in contact with master server to [un]subscribe the user
        $result = posttohost("http://master.php.net/entry/subscribe.php", array("request" => $request, "email" => $_POST['email'], "maillist" => $_POST['maillist'], "remoteip" => $remote_addr, "referer" => $MYSITE . "mailing-lists.php"));
        // Provide error if unable to [un]subscribe
        if ($result) {
            $error = "We were unable to subscribe you due to some technical problems.<br>" . "Please try again later.";
        }