<?php
include("baglanti.php");
$username_err="";
if(isset($_POST["kayit"])){
if(empty($_POST["kullaniciadi"]))
{
$username_err="Kullanıcı adı boş geçilemez";
}
else if(strlen($_POST["kullaniciadi"])<5){
$username_err="kullanıcı adı en az 5 harf olmalıdır! ";
}
$name=$_POST["kullaniciadi"];
$email=$_POST["email"];
$password=password_hash($_POST["parola"],PASSWORD_DEFAULT);
$ekle="INSERT INTO kullanicilar (kullanici_adi, email, parola) VALUES ('$name', '$email', '$password')";
$calistirekle = mysqli_query($baglanti, $ekle);
if($calistirekle) {
echo '<p><font color="white">Kayıt işleminiz başarıyla gerçekleşti!</font></p>' ;
}
else{
echo '<p><font color="white">Kaydınız oluşturulurken bir hata meydana geldi!</font></p>';
}
}
?>