Bu sayfaya reCAPTCHA eklemek istiyorum. İnternet üzerinden kod buldum ancak sayfa yapısı bozuldu. Yardımcı olabilir misiniz?
<!DOCTYPE html>
<html lang="tr">
<head>
<?php
include 'inc/head.php';
if (isset($_SESSION['user_email']))
{
header("location:index");
exit;
}
?>
</head>
<body>
<div class="<?php if ($mobile == "1") {
echo "container-fluid";
} else {
echo "container";
} ?>">
<?php include 'inc/menu.php' ?>
<hr>
<main>
<section class="vh-xxl-100">
<div class="container h-100 px-0 px-sm-4">
<div class="row justify-content-center align-items-center">
<div class="col-xl-4 col-lg-5 col-md-6 col-sm-9 col-11">
<div class="card border shadow rounded-3">
<div class="card-body">
<!-- Title -->
<h1 class="mb-2 h3">Yeni bir hesap oluştur</h1>
<p class="mb-0 small">Zaten hesabın var mı?<a href="giris"> Giriş yap</a></p>
<!-- Form START -->
<form class="mt-4 text-start">
<!-- Email -->
<div class="mb-3">
<label for="user_name" class="form-label">Ad Soyad</label>
<input type="text" id="user_name" class="form-control">
</div>
<div class="mb-3">
<label for="user_email" class="form-label">E-Posta</label>
<input type="email" id="user_email" class="form-control">
</div>
<div class="mb-3">
<label for="user_phone" class="form-label">Telefon</label>
<input type="text" id="user_phone" class="form-control onlynumber" maxlength="10">
</div>
<!-- Password -->
<div class="mb-3 position-relative">
<label for="user_password" class="form-label">Şifre</label>
<input class="form-control fakepassword" type="password" id="user_password">
<span class="position-absolute top-50 end-0 translate-middle-y p-0 mt-3">
<i class="fakepasswordicon fas fa-eye-slash pointer p-2"></i>
</span>
</div>
<!-- Confirm Password -->
<div class="mb-3 position-relative">
<label for="user_password_again" class="form-label">Tekrar Şifre</label>
<input class="form-control fakepassword" type="password" id="user_password_again">
<span class="position-absolute top-50 end-0 translate-middle-y p-0 mt-3">
<i class="fakepasswordicon2 fas fa-eye-slash pointer p-2"></i>
</span>
</div>
<div class="mb-3">
<input type="checkbox" class="form-check-input" id="user_privacy">
<label class="form-check-label small" for="user_privacy">Kullanıcı Sözleşmesini Kabul Ediyorum</label>
</div>
<!-- Remember me -->
<!-- Button -->
<div><button type="button" id="user_register" class="btn btn-orange w-100 mb-0">Kayıt Ol</button></div>
</form>
<!-- Form END -->
</div>
</div>
</div>
</div>
</div>
<?php include 'inc/footer.php' ?>
</section>
</main>
<?php include 'inc/script.php'; ?>
<script type="text/javascript">
var isRtl = $('html').attr('data-textdirection') === 'rtl',
clearToastObj;
$(document).ready(function() {
$(".onlynumber").keypress(function(e) {
if (this.value.match(/[^0-9]/g)) {
this.value = this.value.replace(/[^0-9]/g, '');
toastr['warning']('Lütfen sadece rakam giriniz!', 'Uyarı!', {
closeButton: true,
tapToDismiss: false,
progressBar: true,
rtl: isRtl
});
}
});
$('#user_phone').keypress(function(e) {
if (event.keyCode == 32) {
toastr['warning']('Lütfen boşluk girmeyiniz!');
return false;
}
if (this.value.match(/[^0-9]/g)) {
this.value = this.value.replace(/[^0-9]/g, '');
toastr['warning']('Lütfen sadece rakam giriniz!');
}
if (this.value.length == 0 && e.which == 48) {
toastr['warning']('Lütfen numaranızın başına 0 eklemeyiniz!');
return false;
}
if (this.value.length == 0 && e.which != 53) {
toastr['warning']('Lütfen numaranızı 5 ile başlayacak şekilde yazınız!');
return false;
}
});
$("#user_phone").bind("cut copy paste", function() {
toastr['warning']('Bu Alanda Kesme, Kopyalama ve Yapıştırma İşlemi Yapamazsınız!');
return false;
});
$("#user_register").click(function() {
var user_register = "user_register";
var user_name = $("#user_name").val();
var user_email = $("#user_email").val();
var user_phone = $("#user_phone").val();
var user_password = $("#user_password").val();
var user_password_again = $("#user_password_again").val();
var user_privacy = $("#user_privacy").val();
if ($("#user_phone").val().indexOf(0) == 0) {
toastr['warning']('Lütfen numaranızın başına 0 eklemeyiniz!');
return false;
}
if (!user_name.length || !user_email.length || !user_password.length || !user_password_again.length || !user_phone.length || !$('#user_privacy').is(':checked')) {
toastr['warning']('Tüm Alanları Doldurunuz!');
return false;
}
$.ajax({
type: "POST",
url: "inc/inc.php",
data: {
user_register: user_register,
user_name: user_name,
user_email: user_email,
user_phone: user_phone,
user_password: user_password,
user_password_again: user_password_again,
user_privacy: user_privacy
},
success: function(e) {
if (e == "ok") {
toastr["success"]("Kayıt Başarılı! Yönlendiriliyorsunuz...");
window.location.href = 'index';
} else if (e == "no") {
toastr['error']('Kayıt işleminiz başarısız!');
} else if (e == "email") {
toastr['error']('Bu e-posta adresi kullanılıyor!');
} else if (e == "phone") {
toastr['error']('Bu telefon numarası kullanılıyor!');
} else if (e == "password-again") {
toastr['error']('Şifreler uyuşmuyor!');
} else if (e == "password") {
toastr['error']('Şifreniz 8 karakterden kısa olamaz!');
}
},
error: function(e) {
toastr['error']('Kayıt işleminiz başarısız!');
}
});
});
/*$("#send_code").click(function() {
var send_code="send_code";
var phone_code=$("#phone_code").val();
var user_phone2=$("#user_phone").val();
if (!phone_code.length) {
toastr['warning']('Kod Alanı Boş Bırakılamaz!', 'Uyarı!', {
closeButton: true,
tapToDismiss: false,
progressBar: true,
rtl: isRtl
});
return false;
}
$.ajax({
type: "POST",
url: "inc/inc-user.php",
data: {send_code:send_code,phone_code:phone_code,user_phone2:user_phone2},
success: function(e) {
if (e=="ok") {
window.location.href = 'panel/search?register=success';
}
else {
toastr['error']('Girmiş Olduğunuz Kod Yanlış!', 'Başarısız!', {
closeButton: true,
tapToDismiss: false,
progressBar: true,
rtl: isRtl
});
}
},
error: function(e) {
toastr['error']('Girmiş Olduğunuz Kod Yanlış!', 'Başarısız!', {
closeButton: true,
tapToDismiss: false,
progressBar: true,
rtl: isRtl
});
}
});
});*/
$(".fakepasswordicon").on('click', function() {
$(this).toggleClass("fa-eye-slash");
$(this).toggleClass("fa-eye");
var input = $("#user_password");
if ($(input).attr("type") == "password") {
$(input).attr("type", "text");
} else {
$(input).attr("type", "password");
}
});
$(".fakepasswordicon2").on('click', function() {
$(this).toggleClass("fa-eye-slash");
$(this).toggleClass("fa-eye");
var input2 = $("#user_password_again");
if ($(input2).attr("type") == "password") {
$(input2).attr("type", "text");
} else {
$(input2).attr("type", "password");
}
});
});
</script>
</body>
</html>
