SitePoint Sponsor |
|
User Tag List
Results 26 to 28 of 28
-
Sep 11, 2009, 03:11 #26
- Join Date
- Aug 2007
- Location
- Netherlands
- Posts
- 10,287
- Mentioned
- 51 Post(s)
- Tagged
- 2 Thread(s)
Robots.txt is your friend... Good Bots follow it.
-
Sep 11, 2009, 10:04 #27
- Join Date
- Sep 2009
- Posts
- 1
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi,
One way that I check for bots is:
Code PHP:$UI_Agent = $_SERVER['HTTP_USER_AGENT']; if(eregi("googlebot", $UI_Agent)) { // you have found Google's bot! ... }
HTH,
Bud
Owner/Webmaster/... - Manz Web Designs, LLC
-
Sep 11, 2009, 10:19 #28
- Join Date
- Jun 2006
- Posts
- 638
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
321web the simple pseudo-code is this:
PHP Code:<?php
session_start();
// Someone submited the form, after 10 sec of first get
if ((isPost('btnSubmit')) && (isset($_SESSION['form'][$PHP_SELF]) && $_SESSION['form'][$PHP_SELF] < time() - 10)) {
unset($_SESSION['form'][$PHP_SELF]);
// save / validate form
if (save()) {
setMessage('form saved');
// 302
header('Location: /');
exit;
}else{
setError('form has errors');
// They can fix the form much faster than they can fill it (say 1 -2 sec?)
$_SESSION['form'][$PHP_SELF] = time() - 9;
}
} else
// Someone just loaded the page, load defaults
{
$_SESSION['form'][$PHP_SELF] = time();
}
?>
html
...
-- POST form --
...
Bookmarks