Jump to content

Php Captcha Ekleme


Recommended Posts

BİR KAYIT OL SİSTEMİ VAR BÜGÜN BOTLAR TARAFINDAN 1600 KİŞİ ÜYE OLMUŞ VERİTABANI ŞİŞMİŞ BUNU ENGELLEMEM İÇİN CAPTCHA GÜVENLİK LAZIM EKLEMEYE ÇALIŞTIM EKLEYEMEDİM YARDIMCI OLUCAK ARKADAŞLAR EKLEYEYİP VEREBİLİRMİ

<?php

session_start();
error_reporting(0);
include "config.php";

$ad=mysql_real_escape_string(htmlspecialchars($_POST['ad']));
$soyad=mysql_real_escape_string(htmlspecialchars($_POST['soyad']));
$sifre=mysql_real_escape_string(htmlspecialchars($_POST['sifre']));
$mail=mysql_real_escape_string(htmlspecialchars($_POST['mail']));
$tel=mysql_real_escape_string(htmlspecialchars($_POST['tel']));

if($ad && $soyad && $tel && $mail && $sifre){
$dogrula = mysql_result(mysql_query("SELECT count(id) AS toplam FROM uyeler WHERE mail='$mail'"), 0, 'toplam');
if ($dogrula == 0)
{
mysql_query("INSERT INTO uyeler (ad, soyad, sifre, mail, tel) VALUES ('$ad', '$soyad', '$sifre', '$mail', '$tel')");
echo'<script>alert("Kayit isleminiz tamamlanmistir. Giris yapabilirsiniz..."); location.href="login.php";</script>';
}else{
echo '<script>alert("Daha Once bu mail ismiyle yada maille kayit olunmus...");</script>';
}
}
?>
<!doctype html>
<html>
<link REL="SHORTCUT ICON" HREF="img/favicon.ico">
<head>
	<title><?php echo $title; ?></title>
	<meta charset="utf8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	

	<!-- Bootstrap -->
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<!-- Bootstrap responsive -->
	<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
	<!-- Theme CSS -->
	<!--[if !IE]> -->
	<link rel="stylesheet" href="css/style.css">
	<!-- <![endif]-->
	<!--[if IE]>
	<link rel="stylesheet" href="css/style_ie.css">
	<![endif]-->

	<!-- jQuery -->
	<script src="js/jquery.min.js"></script>
	<!-- Bootstrap -->
	<script src="js/bootstrap.min.js"></script>

	<!-- Just for demonstration -->
	<script src="js/demonstration.min.js"></script>
	<!-- Theme scripts -->
	<script src="js/application.min.js"></script>

</head>
<body class='login-body'>
	<div class="login-wrap">
		<h2>Facebegen.com</h2>
		<h2>KAYIT OL</h2>
		<div class="login">
			<form action="" method="POST">
				<input type="text" name="mail" placeholder="Email" class='input-block-level'>
				<input type="password" name="sifre" placeholder="Password" class='input-block-level'>
				<input type="text" name="tel" placeholder="Telefon" class='input-block-level'>
				<input type="text" name="ad" placeholder="Ad" class='input-block-level'>
				<input type="text" name="soyad" placeholder="Soyad" class='input-block-level'>
				<button type="submit" value="Sign In" class='button button-basic-darkblue btn-block'>Kayıt Ol</button>
			</form>
		</div>
		<a href="login.php?sayfa=lostPassword" class='pw-link'>Şifrenizi mi <span>Unuttunuz</span>? <i class="icon-arrow-right"></i></a>
	</div>
</body>

</html>
Link to comment
Share on other sites

Bir çalışma yaptım, umarım işinize yarar:
 
Not: stil dosyaları olmadığı için biçimsiz olabilir, siz düzenlersiniz.
 
Kodlar:
 
[spoiler]

<?php

session_start();
error_reporting(0);
include "config.php";

$ad=mysql_real_escape_string(htmlspecialchars($_POST['ad']));
$soyad=mysql_real_escape_string(htmlspecialchars($_POST['soyad']));
$sifre=mysql_real_escape_string(htmlspecialchars($_POST['sifre']));
$mail=mysql_real_escape_string(htmlspecialchars($_POST['mail']));
$tel=mysql_real_escape_string(htmlspecialchars($_POST['tel']));
$dogrulama = mysql_real_escape_string(htmlspecialchars($_POST['dogrulama']));
$kontrol = mysql_real_escape_string(htmlspecialchars($_POST['kontrol']));

if($ad && $soyad && $tel && $mail && $sifre && $kontrol)
	{
	if ($kontrol == $dogrulama)
	{
	$dogrula = mysql_result(mysql_query("SELECT count(id) AS toplam FROM uyeler WHERE mail='$mail'"), 0, 'toplam');
		if ($dogrula == 0)
		{
		mysql_query("INSERT INTO uyeler (ad, soyad, sifre, mail, tel) VALUES ('$ad', '$soyad', '$sifre', '$mail', '$tel')");
		echo'<script>alert("Kayit isleminiz tamamlanmistir. Giris yapabilirsiniz..."); location.href="login.php";</script>';
		} 
		else
		{
		echo '<script>alert("Daha Once bu mail ismiyle yada maille kayit olunmus...");</script>';
		}
	}

	else
	{
	echo'<script>alert("Doğrulama kodunu yanlış girdiniz!");</script>';
	}
}
?>
<!doctype html>
<html>
<link REL="SHORTCUT ICON" HREF="img/favicon.ico">
<head>
	<title><?php echo $title; ?></title>
	<meta charset="utf8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	

	<!-- Bootstrap -->
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<!-- Bootstrap responsive -->
	<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
	<!-- Theme CSS -->
	<!--[if !IE]> -->
	<link rel="stylesheet" href="css/style.css">
	<!-- <![endif]-->
	<!--[if IE]>
	<link rel="stylesheet" href="css/style_ie.css">
	<![endif]-->

	<!-- jQuery -->
	<script src="js/jquery.min.js"></script>
	<!-- Bootstrap -->
	<script src="js/bootstrap.min.js"></script>

	<!-- Just for demonstration -->
	<script src="js/demonstration.min.js"></script>
	<!-- Theme scripts -->
	<script src="js/application.min.js"></script>

</head>
<body class='login-body'>
	<div class="login-wrap">
		<h2>Facebegen.com</h2>
		<h2>KAYIT OL</h2>
		<div class="login">

		<?php
		$rand1 = rand(0, 9);
		$rand2 = rand(0, 9);
		$rand3 = rand(0, 9);
		$rand4 = rand(0, 9);
		$rand5 = rand(0, 9);
		$rand6 = rand(0, 9);
		$kontrol = $rand1 . $rand2 . $rand3 . $rand4 . $rand5 . $rand6;
		?>
			<form action="" method="POST">
				<input type="text" name="mail" placeholder="Email" class='input-block-level'>
				<input type="password" name="sifre" placeholder="Password" class='input-block-level'>
				<input type="text" name="tel" placeholder="Telefon" class='input-block-level'>
				<input type="text" name="ad" placeholder="Ad" class='input-block-level'>
				<input type="text" name="soyad" placeholder="Soyad" class='input-block-level'>
				<label for="male">Doğrulama: </label> 
				<?php
				echo "<img src=\"captcha/$rand1.png\" /><img src=\"captcha/$rand2.png\" /><img src=\"captcha/$rand3.png\" /><img src=\"captcha/$rand4.png\" /><img src=\"captcha/$rand5.png\" /><img src=\"captcha/$rand6.png\" />";
				?>
				<input type="hidden" name="dogrulama" value="<?php echo $kontrol; ?>">
				<input type="text" name="kontrol" placeholder="Dogrulama kodunu girin" class='input-block-level'>
				<button type="submit" value="Sign In" class='button button-basic-darkblue btn-block'>Kayıt Ol</button>
			</form>
		</div>
		<a href="login.php?sayfa=lostPassword" class='pw-link'>Şifrenizi mi <span>Unuttunuz</span>? <i class="icon-arrow-right"></i></a>
	</div>
</body>

</html>

[/spoiler]
 
Dosyalar:
 
https://www.sugarsync.com/pf/D1846013_160_667511063

Link to comment
Share on other sites

 

Buradaki örneği inceledim, çok profosyonel bir çalışma olmuş, bence benimkini değil bu örnektekini kullanmalısın, çünkü sağlam yazılmış bir bot benim kodları aşabilir, basit bir sistem çünkü. ama normal botları savuşturacaktır :)

Link to comment
Share on other sites

Unutmuşum ben bu konuyu. Sen işini halletmiş olsan da belki başka birinin işine yarar. Kendim deneme amaçlı yazmıştım, doğrulama kodunun büyüklüğünü ve zorluk seviyesini ayarlayabiliyorsunuz:

http://www.mediafire.com/?dn88aybkb8jwnn3
Link to comment
Share on other sites

Hocam eline sağlık denedim fakat zorluk seviyesini 99999 yaptım ftp ye attım açtım chrome den öğeyi denetle dedim zorluk seviyesini 99999 iken seviye 1 yaptım kodlar goruktu 5 seviye yapsakta chromeden öğeyi denetleden 1 yapabilirler

Link to comment
Share on other sites

99999 diye bişey yok maximum seviyeden büyükse maximum seviyeyi baz alır. ayrıca öğeyi denetle diyerek değiştirmeleri pek bir mana içermiyor sadece çizgi sayısı azalıyor captcha yine oluşturuluyor ki bu bile bi botun yapabilecei bişey değil. ve dahası... seviye parametresi zorunlu bi parametre değil eğer resmi default çağırırsan seviye parametresinden haberdar olamaz kullanıcı ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...