Junior Spellweaver
- Joined
- Sep 14, 2005
- Messages
- 119
- Reaction score
- 15
This is for my ogame share
open reg.php
search for
put after
save and close
Make new php file called captcha.php to root directory
save and close
open templates/opengame/registryform.tpl
put this anywhere
save and close
open language/yourlang/reg.mo
put anywhere you want
open reg.php
search for
Code:
if(!is_email($_POST['email'])){
$errorlist .= "\"".$_POST['email']."\" ".$lang['error_mail'];
$errors++;
}
put after
Code:
session_start();
$girilen = $_REQUEST["captcha"];
if($_SESSION['captcha'] == $girilen){
echo "";
}else{
$errorlist .= $lang['error_captcha'];
$errors++;
}
Make new php file called captcha.php to root directory
Code:
<?php // Captcha by DeimosX
session_start();
$en=100;
$boy=25;
$sayi = mt_rand(0,9999999);
$_SESSION['captcha'] = $sayi;
$tuval = imagecreatetruecolor($en,$boy);
$b = imagecolorallocate($tuval,175,238,238);
$s = imagecolorallocate($tuval,0,0,0);
imagefill($tuval,0,0,$s);
imageline($tuval,20,50,$en,$boy,$b);
imagestring($tuval,3,27,7,$sayi,$b);
Header("content-type:image/gif");
imagegif($tuval);
imagedestroy($tuval);
?>
open templates/opengame/registryform.tpl
put this anywhere
Code:
<tr>
<td>Security image</td>
<td><img src="captcha.php"></td>
</tr>
<tr><td>Code</td>
<td><br><input type="text" name="captcha" size="20" maxlength="20" /></td>
</tr>
open language/yourlang/reg.mo
put anywhere you want
Code:
$lang['error_captcha'] = 'Wrong Security Code<br />';