in reply to Dont allow multiple registrations or automated script problem
How about this? (Not tested.)
$sth = $dbh->prepare("SELECT COUNT(*) FROM users WHERE host=? AND date +>DATE_SUB(NOW(), INTERVAL 5 MINUTE)"); $sth->execute($host); $row = $sth->fetchrow_arrayref or die "some kinda error"; if ($row->[0]) { # there's already a user in the database which was # registered from this IP, less than five minutes ago. # fail in some way. }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dont allow multiple registrations or automated script problem
by Nik (Initiate) on Oct 21, 2006 at 15:06 UTC | |
by davido (Cardinal) on Oct 21, 2006 at 15:46 UTC | |
by Nik (Initiate) on Oct 21, 2006 at 16:08 UTC | |
by davido (Cardinal) on Oct 22, 2006 at 07:12 UTC | |
by ysth (Canon) on Oct 22, 2006 at 17:57 UTC |