note 37557 added to function.rand
| From: | krang at krang dot org dot uk | Date: | Wed, 19 Nov 2003 17:16:52 +0000 |
| Subject: | note 37557 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60632@lists.php.net to get a copy of this message | ||
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";
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37557
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37557&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37557&report=yes
Search -- http://master.php.net/manage/user-notes.php