<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>KAYIT FORM SAYFASI</title>
</head>
<body>
<form action='ekleme_sayfasi.php' method="post">
<table width="328" height="118" align="center">
<tr>
<td> Personel Id : </td>
<td><input type="text" id="personel_id" name="personel_id" value="Lütfen Boş Bırakmayınız! " onclick="document.getElementById('personel_id').value=''"></td>
</tr>
<tr>
<td> Personel Ad : </td>
<td><input type="text" id="personel_ad" name="personel_ad" value="Lütfen Boş Bırakmayınız!" onclick="document.getElementById('personel_ad').value=''"></td>
</tr>
<tr>
<td> Personel Soyad : </td>
<td><input type="text" id="personel_soyad" name="personel_soyad" value="Lütfen Boş Bırakmayınız!" onclick="document.getElementById('personel_soyad').value=''"></td>
</tr>
<tr>
<td> Personel Doğum Tarihi : </td>
<td><input type="text" id="personel_dogum_tar" name="personel_dogum_tar" value="Lütfen Boş Bırakmayınız!" onclick="document.getElementById('personel_dogum_tar').value=''"></td>
</tr>
<tr>
<td> Personel Tel : </td>
<td><input type="text" id="personel_tel" name="personel_tel" value="Lütfen Boş Bırakmayınız!" onclick="document.getElementById('personel_tel').value=''"></td>
</tr>
<tr>
<td> Personel E-mail : </td>
<td><input type="text" id="personel_email" name="personel_email" value="Lütfen Boş Bırakmayınız!" onclick="document.getElementById('personel_email').value=''"></td>
</tr>
<tr>
<td> E-mail Şifresi : </td>
<td><input type="password" id="personel_sifre" name="personel_sifre" value="Lütfen Boş Bırakmayınız!" onclick="document.getElementById('personel_sifre').value=''"></td>
</tr>
<tr>
<td colspan="2"><button type="submit" name="ekle" value="ekle">EKLE</button></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"></td>
<td style="color:#66FF00"><a href="cikis_sayfasi.php"> ÇIKIŞ </a></td>
</tr>
</table>
</form>
</body>
</html>
Şimdide ekleme_sayfasi.php yapıyoruz
<?php
if(!$baglan=mysql_connect("localhost","root","")) die("mysql bağlantısında bir hata olustu.");
$sec = mysql_select_db("deneme",$baglan);
mysql_query ("SET NAMES 'latin5'");
$personel_id=$_POST['personel_id'];
$personel_ad=$_POST['personel_ad'];
$personel_soyad=$_POST['personel_soyad'];
$personel_dogum_tar=$_POST['personel_dogum_tar'];
$personel_tel=$_POST['personel_tel'];
$personel_email=$_POST['personel_email'];
$personel_sifre=$_POST['personel_sifre'];
$sorgu3 = mysql_query("SELECT * FROM personel where personel_email='$personel_email'");
if(!mysql_num_rows($sorgu3))
{
if(mysql_query("insert into personel(personel_id,personel_ad,personel_soyad,personel_dogum_tar,personel_tel,personel_email,personel_sifre) values('$personel_id','$personel_ad','$personel_soyad','$personel_dogum_tar','$personel_tel','$personel_email','$personel_sifre')"))
{
echo "Kayıt başarıyla eklendi...";
}
}
else
{
echo "Böyle kayıt zaten var.Lütfen tekrar deneyiniz...";
}