Long version (OMG Its a freakish paragraph :eek: )
I am running a Online browser based game that runs on php. I have been trying to installed recaptcha (betterish than normal captcha) on the pages where players build stuff to increase their points. rather than making it annoying for the players to fill it our each time they build I worked around trying to make it happen every 20 pages or so. All I need it to do is confuse anyone using a script or a macro.
Short Version 😃
I need the script to only run the recaptcha every 20 page loads here is what I have and it doesn't work.
Valuable page info:
This is the main page that links to everything they build. Example: buildings.php?mode=buildingfleet
<?php
/**
* buildings.php
*
* @version 1.3
* @copyright 2008 by Chlorel for XNova
*/
define('INSIDE' , true);
define('INSTALL' , false);
$xnova_root_path = './';
include($xnova_root_path . 'extension.inc');
include($xnova_root_path . 'common.' . $phpEx);
includeLang('buildings');
// Mise a jour de la liste de construction si necessaire
UpdatePlanetBatimentQueueList ( $planetrow, $user );
$IsWorking = HandleTechnologieBuild ( $planetrow, $user );
//recaptcha start
if($_SESSION['pagesloaded'] % 20 == 1){
require_once('recaptchalib.php');
$privatekey = "6Lf4vwIAAAAAAEpmSd8sJIN7SKyMFzSdP8AxYIXa";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"])
//recaptcha end
if (!$resp->is_valid) {
die ("<center><meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=wall.php\"></center>" .
"Error: " . $resp->error . ")");
}
switch ($_GET['mode']) {
case 'fleet':
// --------------------------------------------------------------------------------------------------
FleetBuildingPage ( $planetrow, $user );
break;
case 'research':
// --------------------------------------------------------------------------------------------------
ResearchBuildingPage ( $planetrow, $user, $IsWorking['OnWork'], $IsWorking['WorkOn'] );
break;
case 'defense':
// --------------------------------------------------------------------------------------------------
DefensesBuildingPage ( $planetrow, $user );
break;
default:
// --------------------------------------------------------------------------------------------------
BatimentBuildingPage ( $planetrow, $user );
break;
}
}
// -----------------------------------------------------------------------------------------------------------
// History version
// 1.0 - Nettoyage modularisation
// 1.1 - Mise au point, mise en fonction pour linéarisation du fonctionnement
// 1.2 - Liste de construction batiments
?>