Difference between revisions of "Nobots.php"

From Organic Design wiki
m (No need for hidden value)
(Redirect unless meatware)
Line 1: Line 1:
 
<?
 
<?
 
# Add an "I am a human" checkbox to stop spambots for a while
 
# Add an "I am a human" checkbox to stop spambots for a while
$article = preg_replace(
+
if ($event == 'view') {
"/(Your email\\*:.+?)<\\/tr>/is",
+
$article = preg_replace(
"$1<td align='left'><input type='checkbox' name='xwSpecies' value='meat'>Yes I'm a meat creature</td></tr>",
+
"/(Your email\\*:.+?)<\\/tr>/is",
$article
+
"$1<td align='left'><input type='checkbox' name='xwSpecies' value='meat'>Yes I'm a meat creature</td></tr>",
);
+
$article
$article = str_replace( '(new users only)', '(new users only - no robots!)', $article );
+
);
 +
$article = str_replace( '(new users only)', '(new users only - no robots!)', $article );
 +
else {
 +
xwSetProperty( $properties, 'xpath:/properties:view', $tTitle );
 +
if ( $_REQUEST['wpCreateaccount'] ) {
 +
if ( $_REQUEST['xwSpecies'] != 'meat' )
 +
header( "Location: http://" .$_SERVER['HTTP_HOST'].'/No+Bots!' );
 +
}
 +
}
 
?>
 
?>

Revision as of 05:27, 3 March 2006

<?

  1. Add an "I am a human" checkbox to stop spambots for a while

if ($event == 'view') { $article = preg_replace( "/(Your email\\*:.+?)<\\/tr>/is",

"$1<input type='checkbox' name='xwSpecies' value='meat'>Yes I'm a meat creature",

$article ); $article = str_replace( '(new users only)', '(new users only - no robots!)', $article ); else { xwSetProperty( $properties, 'xpath:/properties:view', $tTitle ); if ( $_REQUEST['wpCreateaccount'] ) { if ( $_REQUEST['xwSpecies'] != 'meat' ) header( "Location: http://" .$_SERVER['HTTP_HOST'].'/No+Bots!' ); } } ?>