-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajax.php
27 lines (25 loc) · 807 Bytes
/
ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
include 'ayar.php';
header("Content-Type : text/html; charset = iso-8859-9");//turkçe uyumluluğu
//Gelen degerleri alalım
$a = $_POST["adsoyad"];
$b = $_POST["eposta"];
$c = iconv('UTF-8','ISO-8859-9', $_POST["yorum"]);
if(empty($a) || empty($b) || empty($c)){
echo "hata1";
}else{
$ekle = mysql_query("insert into yorum(yazan,eposta,yorum) values('$a','$b','$c')");
if($ekle){
$id = mysql_insert_id();// bu bizim son eklenen içeriğimizin otomatik artan değeri
$bul = mysql_query("select * from yorum where id ='$id'");
$goster = mysql_fetch_array($bul);
extract($goster);
echo "<div class='yorum'>
<div class= 'demiski'><strong>{$yazan}</strong> demişki;</div>
<div class = 'yorum_ic'>{$yorum}</div>
</div>";
}else {
echo "hata2";
}
}
?>