2. if kullanımda endif değilde normal parantezli if kullanmak daha sağlıklı.İç içe iflerde if:endif; önerilmez.
<?php  
 
 
if (isset($_POST["buton"])):
 
$ad=htmlspecialchars($_POST["ad"]);
$soyad=htmlspecialchars($_POST["soyad"]);
 
if (empty($ad) or empty($soyad)){
echo "boş olamaz ";
}else{
$baglanti->query("insert into kisisel (ad,soyad) VALUES ('$ad','$soyad')");
echo "başarılı";
}
endif;


 
?>
 
 
 
 
<form action=" " method="post">
 
<input type="text" name="ad" />
 
<input type="text" name="soyad" />
<input type="submit" name="buton" value="EKLE" />
 
</form>