Cuma , 29 Mart 2024

İnternet Programcılığı Veri Tabanı İşlemleri


VERİ KAYDETME İŞLEMLERİ

Kayıt Formu

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
</head>

<body>
<form id=”form1″ name=”form1″ method=”post” action=”kaydet.php”>
<table width=”500″ border=”1″ align=”center” cellpadding=”0″ cellspacing=”0″>
<tr>
<td colspan=”2″ align=”center”>ÖĞRENCİ KAYIT TABLOSU</td>
</tr>
<tr>
<td width=”276″>ÖĞRENCİ ADI SOYADI</td>
<td width=”218″><label for=”ogrenci_adi_soyadi”></label>
<input type=”text” name=”ogrenci_adi_soyadi” id=”ogrenci_adi_soyadi” /></td>
</tr>
<tr>
<td>ÖĞRENCİ TELEFON</td>
<td><label for=”ogrenci_telefon”></label>
<input type=”text” name=”ogrenci_telefon” id=”ogrenci_telefon” /></td>
</tr>
<tr>
<td>ÖĞRENCİ CİNSİYET</td>
<td><label for=”ogrenci_cinsiyet”></label>
<select name=”ogrenci_cinsiyet” id=”ogrenci_cinsiyet”>
<option value=”ERKEK”>ERKEK</option>
<option value=”KADIN”>KADIN</option>
</select></td>
</tr>
<tr>
<td colspan=”2″ align=”center”><input type=”submit” name=”button” id=”button” value=”KAYDET” />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=”reset” name=”button2″ id=”button2″ value=”VAZGEÇ” /></td>
</tr>
</table>
</form>
</body>
</html>

Bağlantı Sayfası

<?php
$db_host=”localhost”;
$db_user=”root”;
$db_pass=””;
$db_name=”deneme12″;
$baglan=mysql_connect($db_host,$db_user,$db_pass) or die(“VERITABANI SUNUCUSUNA BAGLANILAMIYOR”);
@mysql_select_db($db_name) or die(“VERITABANINA BAGLANILAMIYOR”);

?>

Kaydetme Sayfası

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
</head>

<body>
<?php
include(“baglan.php”);
$gisim=$_POST[‘ogrenci_adi_soyadi’];
$gtel=$_POST[‘ogrenci_telefon’];
$gcinsiyet=$_POST[‘ogrenci_cinsiyet’];
$sorgu=”INSERT INTO basitogrenci(kayit_adi,kayit_tel,kayit_cinsiyet) VALUES(‘$gisim’,’$gtel’,’$gcinsiyet’)”;
$sonuc=mysql_query($sorgu);
if(!$sonuc)
{
print “BAŞARISIZ OLUNDU KAYIT YAPILAMADI”;
}
else
{
print “BAŞARILI KAYIT TAMAM”;
}
?>
</body>
</html>

 

YENİ ÖRNEK DOSYALARI İNDİR

Bu Konuda İlginizi Çekebilir

Sosyal Medya Dersi Çalışma Soruları

Sosyal Medya Dersi Sınavı Çalışma Soruları SOSYAL MEDYA DERSİ 2. DÖNEM 1. YAZILI SINAVI ÇALIŞMA …