note 37557 deleted from function.rand by aidan
| From: | aidan@php.net | Date: | Sat, 11 Sep 2004 07:40:03 +0000 |
| Subject: | note 37557 deleted from function.rand by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-76446@lists.php.net to get a copy of this message | ||
Note Submitter: krang at krang dot org dot uk
----
Ok, an example of rand which will hopefully cause chaos with spam-bots. Its purpose is to generate
10 random email addresses which will hopefully trick the spam-bot into saving them, so it will fill
its table up with pointless email addresses.
<?PHP
echo "\n\n";
echo '<!-- Anti-Spam Feature -->' . "\n";
srand ((double) microtime() * 948625);
for ($K=0; $K<10; $K++) {
$ADDRESS = '';
$ADDRESS_LENGTH = rand (4,15);
while (strlen($ADDRESS) < $ADDRESS_LENGTH) {
$ADDRESS .= chr(rand (97,122));
}
$DOMAIN = '';
$DOMAIN_LENGTH = rand (4,15);
while (strlen($DOMAIN) < $DOMAIN_LENGTH) {
$DOMAIN .= chr(rand (97,122));
}
echo '<!-- ' . $ADDRESS . '@' . $DOMAIN . '.com -->' .
"\n";
}
?>