Ideas for new modifications and themes
#21
I have got idea and code. But I can't add it into myBB. It's Anti Robotic Register Mod.

index.php
<?php

session_start();  
$resim_kodu=""; 
function rasgele() { 

      $gecici_deger = mt_rand(1,3); 

      switch ($gecici_deger) {

          case 1:

          $gecici_deger = mt_rand(97, 122);

          break;

          case 2:


          $gecici_deger = mt_rand(48, 57);


          break;

          case 3:


          $gecici_deger = mt_rand(65, 90);


          break;

       }


       return chr($gecici_deger);

}



for ($i = 1; $i <= 4; $i++) {

             $resim_kodu.= rasgele();

}



$_SESSION['guvenlik_kodu'] = $resim_kodu;

echo '<html><head><title>Anti Robotic Codes</title></head><body><br>
<form action="check.php" method="POST" name="guvenlik" target="_self">
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr><td>
      <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Please enter code in picture. If you can't see it press F5.</font></p>
      <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><img src="picture.php?';
echo session_id();  
echo '"></font></p>     
        <p><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Enter Code: </font>
          <input name="kod" type="text" id="kod" size="30">
              <input type="submit" name="Submit" value="OK">
        </p>
      <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
            <b>Note:</b>Check small-big letters
      </p>
    </td></tr>
</table></form></body></html>';
?>


picture.php
<?php
session_start();

$guvenlik_kodu= $_SESSION['guvenlik_kodu'];

$resim=imagecreate(100,40);

$resim_siyah = imagecolorallocate($resim,255,255,255);

$resim_beyaz = imagecolorallocate($resim,0,0,0);

imagefill($resim,0,0,$resim_siyah);

imagechar($resim,4,20,13,$guvenlik_kodu[0],$resim_beyaz);

imagechar($resim,5,40,13,$guvenlik_kodu[1],$resim_beyaz);

imagechar($resim,3,60,13,$guvenlik_kodu[2],$resim_beyaz);

imagechar($resim,4,80,13,$guvenlik_kodu[3],$resim_beyaz);

header('Content-type: image/png');

imagepng($resim);

?>



check.php
<?php

session_start();

$girilen_kod = $_POST['kod'];

$guvenlik_kodu=$_SESSION['guvenlik_kodu'];

if ($girilen_kod == $guvenlik_kodu) {

       echo 'You entered right code. Congratulations.';

}

else {

       echo 'You entered wrong. Moron.';

}


session_unset();

session_destroy();

?>

That's it. I can't add them into register.
Reply
#22
Interesting
www.volvl.com | Get your first month of hosting for $0.01 USD with Promo Code: Hexeus
[Image: 12946833.gif]


Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)