• 28-08-2010, 03:45:58
    #1


    arkadaşlar resimde görülen forma captcha eklemek istiyorum yardımcı olabilir misiniz ? en alttaki Kayıt Ol butonu ile önce captcha kodunu işlemeli eğer doğru ise üye yapma işlemini gerçekleştirmeli eğer doğru değilse Hatalı Giriş Kodu diye hata vermeli.

    Buyrun sayfa kodları :

    <?php include("tema/inc/ayarlar.php") ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <?php include("tema/inc/meta.php") ?>
    <link rel="icon" type="image/png" href="tema/style/images/favicon.png"/>
    <link rel="stylesheet" href="tema/style/style.css" type="text/css" media="screen"/>
    <script type="text/javascript" src="tema/ie6block/jquery-1.2.6.min.js"></script> 
    <script type="text/javascript" src="tema/ie6block/jquery.ie6blocker.js"></script> 
    <title><?php echo $oyunadi; ?> | Kayıt Ol</title>
    </head>
    <body>
    <center>
    
    <div class="mainwrapper" id="top">
      
      <a href="/" class="logo_link">&nbsp;</a>
      
      <div class="main_menu">
      <?php include("tema/inc/menu.php") ?> 
      </div>
     
      <div class="contwrapper-top">&nbsp;</div>
      <div class="contwrapper">
      
        <div class="side_menu">
        <?php include("tema/inc/yanmenu.php") ?>   
    
         
        <div class="content">
    
        
    <center><h1><?=$oyunadi?> Kayıt Ol</h1></center>
    	<br><b> 
    
    <br> </br>
    	<?php 
    	include('tema/inc/config.php');
    	$dbname = "account";
    	$accq = mysql_query("SELECT * FROM account");
    $acc = mysql_num_rows($accq);
    $acc2 = 30000;
    error_reporting(E_ALL);
    	if(isset($_POST['submit']) && $_POST['submit'] == 'Kayit Ol') {
    	
    		$username = mysql_real_escape_string($_POST['username']);
    		$social_id = mysql_real_escape_string($_POST['code']);
    		$password = mysql_real_escape_string($_POST['password']);
    		$password2 = mysql_real_escape_string($_POST['password2']);
    		$rl_name = mysql_real_escape_string($_POST['rl_name']);
    		$email = mysql_real_escape_string($_POST['email']);
    		
    			$exec="select * from account where Login='$username'";
    	$result=mysql_query($exec);
    	$rs=mysql_fetch_object($result);
    	if ($acc+$acc2==30000)
    	{
    	echo"<center>Üyelik alımları kapatılmıştır.</center>";
    	}
    	if($rs){
    		echo"<center>Hesap Kullanılıyor</center>";
    		}
    		
    		$sql = "INSERT INTO account SET login = '".$username."', password = PASSWORD('".$password."'), real_name = '".$rl_name."', social_id = '".$social_id."', email = '".$email."'" ;
    		$result = mysql_query($sql);
    		if($result) { echo '<center>Kayıt Başarılı bir şekilde olundu.</center>'; 
    		} else { echo '<center>Kayıt olunamadı.Lütfen bilgilerini doğru ve eksiksiz bir biçimde yazın!</center>'; }
    		echo mysql_error();
    	}
    ?>
    <center><b><font color=blue>Şuanda Sistemde </font> <font color=green><?php echo $acc; ?></font> <font color=blue> Kayıtlı Hesap Bulunuyor.Üyelik Sistemi</font><font color=green> <?php echo $acc2; ?> </font><font color=blue>de Kapanıcaktır</font></center><b>
      	<br></p>
      <form  id="Register" name="Register" method="post" action="?site=register">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" height="263">
    <td>
      <b>Isim:</b></td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=rl_name style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b>Email :
    			</b></font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=email style="width:150px;"/>
        </font></td>
        </tr>
    
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
    			<b>Karakter Silme Şifresi: </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=code size="20" style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
    <td width="37%" align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
    			<b>Kullanıcı Adı : </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=username style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
    			<b>Şifre : </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=password name=password style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
    	
    	
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
    			<b>Şifre Tekrarı : </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=password name=password2 style="width:150px;"/>
      </font></td>
        </tr>
    <tr> 
    <td align="center"> 
      <div align="left">&nbsp;</div> 
    </td> 
    <td><font face="Arial, Helvetica, sans-serif" size="2"> 
      <img src="Security/image.php?width=156&height=40&characters=5" /></font></td> 
        	</tr> 
    		<tr> 
    <td align="center"> 
      <div align="left"><b>Güvenlik Kodu:</b></div> 
    </td> 
    <td><font face="Arial, Helvetica, sans-serif" size="2"> 
      <input type=text name=guvenlik id=guvenlik style="width:150px;"/> 
      </font></td> 
        	</tr> 
    <td>&nbsp;</td> 
    <td> 
      &nbsp;<p><font color="#FF0000"> 
      <input type="submit" name="submit" value="Kayit Ol" /> 
     </td>
        </tr>
      	<tr>
    <td colspan="2">
    		<p align="center">&nbsp;</p>
    		</td>
    </tr>
      </table>
    
    </form>
    
    		</div>
        
      <div class="ffix">&nbsp;</div>
      </div>
      <div class="contwrapper-bottom">&nbsp;</div>
      
      <div class="footer">
      <?php include("tema/inc/footer.php") ?>  
        </a></div>
    
    </div>
    </center>
  • 28-08-2010, 04:08:38
    #2
    metin2 kurucum, emek vermişin ama googleye 3 kelime yazman yeterdi :')
    iyi sahurlar..

    http://www.google.com.tr/search?hl=t...=&oq=&gs_rfai=
  • 28-08-2010, 04:27:18
    #3
    Üyeliği durduruldu
    gd2 yüklü mü sunucuda
  • 28-08-2010, 16:34:03
    #4
    hackturk adlı üyeden alıntı: mesajı görüntüle
    metin2 kurucum, emek vermişin ama googleye 3 kelime yazman yeterdi :')
    iyi sahurlar..

    http://www.google.com.tr/search?hl=t...=&oq=&gs_rfai=
    hocam aşırı bi php bilgim yok o yüzden yapamıyorum bir türlü.

    saho adlı üyeden alıntı: mesajı görüntüle
    gd2 yüklü mü sunucuda
    bilgim yok malesef.. :S
  • 28-08-2010, 19:50:18
    #5
    Aşağıdaki kodları "Security/image.php" olarak kaydet. (Çok etkili değil ama işini görür, notlar da var, geliştirmeye açık.)

    < ?php
    //olusturulmus resmi tarayiciya gonderir
    create_image();
    exit(); 
    
    function create_image()
    {
        //md5 ile rastgele sayi uretelim
        $md5 = md5(rand(0,999));
        //32 karakter yerine sadece 5 karakterini aliyoruz
        $pass = substr($md5, 10, 5); 
    
        //resmin boyutlarini ayarliyoruz
        $width = 100;
        $height = 20;  
    
        //resim kaynagini olusturuyoruz
        $image = ImageCreate($width, $height);  
    
        //Beyaz siyah ve gri renklerini olusturuyoruz
        $white = ImageColorAllocate($image, 255, 255, 255);
        $black = ImageColorAllocate($image, 0, 0, 0);
        $grey = ImageColorAllocate($image, 204, 204, 204); 
    
        //Zemini siyah yapiyoruz
        ImageFill($image, 0, 0, $black); 
    
        //Rastgele sayiyi resmin uzerine yaziyoruz
        ImageString($image, 3, 30, 3, $pass, $white); 
    
        //resme birkac cizgi koyuyoruz
        ImageRectangle($image,0,0,$width-1,$height-1,$grey);
        imageline($image, 0, $height/2, $width, $height/2, $grey);
        imageline($image, $width/2, 0, $width/2, $height, $grey);  
    
        //sunucuya resmin turunu belirtiyoruz
        header("Content-Type: image/jpeg");  
    
        //Yeni jpeg formatindaki resmin ciktisini aliyoruz
        ImageJpeg($image); 
    
        //Kaynagi temizliyoruz
        ImageDestroy($image);
    }
    ?>
    Bunlar da senin kodların düzenlenmiş hali;
    <?php include("tema/inc/ayarlar.php") ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <?php include("tema/inc/meta.php") ?>
    <link rel="icon" type="image/png" href="tema/style/images/favicon.png"/>
    <link rel="stylesheet" href="tema/style/style.css" type="text/css" media="screen"/>
    <script type="text/javascript" src="tema/ie6block/jquery-1.2.6.min.js"></script> 
    <script type="text/javascript" src="tema/ie6block/jquery.ie6blocker.js"></script> 
    <title><?php echo $oyunadi; ?> | Kayıt Ol</title>
    </head>
    <body>
    <center>
    
    <div class="mainwrapper" id="top">
      
      <a href="/" class="logo_link">&nbsp;</a>
      
      <div class="main_menu">
      <?php include("tema/inc/menu.php") ?> 
      </div>
     
      <div class="contwrapper-top">&nbsp;</div>
      <div class="contwrapper">
      
        <div class="side_menu">
        <?php include("tema/inc/yanmenu.php") ?>   
    
         
        <div class="content">
    
        
    <center><h1><?=$oyunadi?> Kayıt Ol</h1></center>
        <br><b> 
    
    <br> </br>
        <?php 
        include('tema/inc/config.php');
        $dbname = "account";
        $accq = mysql_query("SELECT * FROM account");
    $acc = mysql_num_rows($accq);
    $acc2 = 30000;
    error_reporting(E_ALL);
        if(isset($_POST['submit']) && $_POST['submit'] == 'Kayit Ol') {
        
            $username = mysql_real_escape_string($_POST['username']);
            $social_id = mysql_real_escape_string($_POST['code']);
            $password = mysql_real_escape_string($_POST['password']);
            $password2 = mysql_real_escape_string($_POST['password2']);
            $rl_name = mysql_real_escape_string($_POST['rl_name']);
            $email = mysql_real_escape_string($_POST['email']);
            $pass = mysql_real_escape_string($_POST['email']);
    		session_start();
    		if($pass!=$_SESSION['pass']) { echo "Güvenlik kodu hatalı."; } else {
    	        $exec="select * from account where Login='$username'";
    		    $result=mysql_query($exec);
    		    $rs=mysql_fetch_object($result);
    		    if ($acc+$acc2==30000) {
    		    echo"<center>Üyelik alımları kapatılmıştır.</center>";
    		    }
    		    if($rs) {
    	        echo"<center>Hesap Kullanılıyor</center>";
    	        }
    	        
    	        $sql = "INSERT INTO account SET login = '".$username."', password = PASSWORD('".$password."'), real_name = '".$rl_name."', social_id = '".$social_id."', email = '".$email."'" ;
    	        $result = mysql_query($sql);
    	        if($result) { echo '<center>Kayıt Başarılı bir şekilde olundu.</center>'; 
    	        } else { echo '<center>Kayıt olunamadı.Lütfen bilgilerini doğru ve eksiksiz bir biçimde yazın!</center>'; }
    	        echo mysql_error();
    		}
        }
    ?>
    <center><b><font color=blue>Şuanda Sistemde </font> <font color=green><?php echo $acc; ?></font> <font color=blue> Kayıtlı Hesap Bulunuyor.Üyelik Sistemi</font><font color=green> <?php echo $acc2; ?> </font><font color=blue>de Kapanıcaktır</font></center><b>
          <br></p>
      <form  id="Register" name="Register" method="post" action="?site=register">
      <table width="100%" border="0" cellspacing="0" cellpadding="0" height="263">
    <td>
      <b>Isim:</b></td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=rl_name style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2"><b>Email :
                </b></font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=email style="width:150px;"/>
        </font></td>
        </tr>
    
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
                <b>Karakter Silme Şifresi: </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=code size="20" style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
    <td width="37%" align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
                <b>Kullanıcı Adı : </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=text name=username style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
                <b>Şifre : </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=password name=password style="width:150px;"/>&nbsp;
      </font></td>
        </tr>
        
        
    <td align="center">
      <div align="left"><font face="Arial, Helvetica, sans-serif" size="2">
                <b>Şifre Tekrarı : </b> </font></div>
    </td>
    <td><font face="Arial, Helvetica, sans-serif" size="2">
      <input type=password name=password2 style="width:150px;"/>
      </font></td>
        </tr>
    <tr> 
    <td align="center"> 
      <div align="left">&nbsp;</div> 
    </td> 
    <td><font face="Arial, Helvetica, sans-serif" size="2"> 
      <img src="Security/image.php?width=156&height=40&characters=5" /></font></td> 
            </tr> 
            <tr> 
    <td align="center"> 
      <div align="left"><b>Güvenlik Kodu:</b></div> 
    </td> 
    <td><font face="Arial, Helvetica, sans-serif" size="2"> 
      <input type=text name=guvenlik id=guvenlik style="width:150px;"/> 
      </font></td> 
            </tr> 
    <td>&nbsp;</td> 
    <td> 
      &nbsp;<p><font color="#FF0000"> 
      <input type="submit" name="submit" value="Kayit Ol" /> 
     </td>
        </tr>
          <tr>
    <td colspan="2">
            <p align="center">&nbsp;</p>
            </td>
    </tr>
      </table>
    
    </form>
    
            </div>
        
      <div class="ffix">&nbsp;</div>
      </div>
      <div class="contwrapper-bottom">&nbsp;</div>
      
      <div class="footer">
      <?php include("tema/inc/footer.php") ?>  
        </a></div>
    
    </div>
    </center>
    Session alreadey started gibi bir hata verirse; session_start(); satırını sil.
  • 29-08-2010, 01:42:19
    #6
    hocam öncelikle yardımınız için teşekkür ederim. ancak şöyle bir sorunumuz var doğru da yazsam yanlış da yazsam Hatalı Güvenlik kodu diyor.

    buyrun resimleri :



  • 29-08-2010, 01:46:35
    #7
    Security/image.php

    < ?php 
    ob_start();
    session_start();
    //olusturulmus resmi tarayiciya gonderir 
    create_image(); 
    exit();  
    
    function create_image() 
    { 
        //md5 ile rastgele sayi uretelim 
        $md5 = md5(rand(0,999)); 
        //32 karakter yerine sadece 5 karakterini aliyoruz 
        $pass = substr($md5, 10, 5);  
        $_SESSION['pass']=$pass;
        //resmin boyutlarini ayarliyoruz 
        $width = 100; 
        $height = 20;   
    
        //resim kaynagini olusturuyoruz 
        $image = ImageCreate($width, $height);   
    
        //Beyaz siyah ve gri renklerini olusturuyoruz 
        $white = ImageColorAllocate($image, 255, 255, 255); 
        $black = ImageColorAllocate($image, 0, 0, 0); 
        $grey = ImageColorAllocate($image, 204, 204, 204);  
    
        //Zemini siyah yapiyoruz 
        ImageFill($image, 0, 0, $black);  
    
        //Rastgele sayiyi resmin uzerine yaziyoruz 
        ImageString($image, 3, 30, 3, $pass, $white);  
    
        //resme birkac cizgi koyuyoruz 
        ImageRectangle($image,0,0,$width-1,$height-1,$grey); 
        imageline($image, 0, $height/2, $width, $height/2, $grey); 
        imageline($image, $width/2, 0, $width/2, $height, $grey);   
    
        //sunucuya resmin turunu belirtiyoruz 
        header("Content-Type: image/jpeg");   
    
        //Yeni jpeg formatindaki resmin ciktisini aliyoruz 
        ImageJpeg($image);  
    
        //Kaynagi temizliyoruz 
        ImageDestroy($image); 
    } 
    ?>

    ile degistirin.
  • 29-08-2010, 14:46:56
    #8
    darbetim adlı üyeden alıntı: mesajı görüntüle
    Security/image.php

    < ?php 
    ob_start();
    session_start();
    //olusturulmus resmi tarayiciya gonderir 
    create_image(); 
    exit();  
    
    function create_image() 
    { 
        //md5 ile rastgele sayi uretelim 
        $md5 = md5(rand(0,999)); 
        //32 karakter yerine sadece 5 karakterini aliyoruz 
        $pass = substr($md5, 10, 5);  
        $_SESSION['pass']=$pass;
        //resmin boyutlarini ayarliyoruz 
        $width = 100; 
        $height = 20;   
    
        //resim kaynagini olusturuyoruz 
        $image = ImageCreate($width, $height);   
    
        //Beyaz siyah ve gri renklerini olusturuyoruz 
        $white = ImageColorAllocate($image, 255, 255, 255); 
        $black = ImageColorAllocate($image, 0, 0, 0); 
        $grey = ImageColorAllocate($image, 204, 204, 204);  
    
        //Zemini siyah yapiyoruz 
        ImageFill($image, 0, 0, $black);  
    
        //Rastgele sayiyi resmin uzerine yaziyoruz 
        ImageString($image, 3, 30, 3, $pass, $white);  
    
        //resme birkac cizgi koyuyoruz 
        ImageRectangle($image,0,0,$width-1,$height-1,$grey); 
        imageline($image, 0, $height/2, $width, $height/2, $grey); 
        imageline($image, $width/2, 0, $width/2, $height, $grey);   
    
        //sunucuya resmin turunu belirtiyoruz 
        header("Content-Type: image/jpeg");   
    
        //Yeni jpeg formatindaki resmin ciktisini aliyoruz 
        ImageJpeg($image);  
    
        //Kaynagi temizliyoruz 
        ImageDestroy($image); 
    } 
    ?>

    ile degistirin.
    verdiğiniz kodlar aldığım Notice yi ortadan kaldırdı ama hala doğru yazdığımda da Hatalı Güvenlik Kodu diyor..
  • 29-08-2010, 18:11:09
    #9
    Gözümden kaçmış, şurada ikinci satırda email yazan yer guvenlik olacak;
            $email = mysql_real_escape_string($_POST['email']);
            $pass = mysql_real_escape_string($_POST['email']);
    şöyle;
            $email = mysql_real_escape_string($_POST['email']);
            $pass = mysql_real_escape_string($_POST['guvenlik']);