table adlı üyeden alıntı:
mesajı görüntüle
22
●7.175
<?php
function GetIP(){
if(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} elseif(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
if (strstr($ip, ',')) {
$tmp = explode (',', $ip);
$ip = trim($tmp[0]);
}
} else {
$ip = getenv("REMOTE_ADDR");
}
return $ip;
}
?>bu olsun. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<?php
$host="localhost";
$user="bilgiler";
$psw="bilgiler";
$db="bilgiler";
$tbl="bilgiler";
include ("func.php");
$paket = $_POST['paket'];
$isim = $_POST['isim'];
$siparisnu = $_POST['siparisnu'];
$kkod = $_POST['kkod'];
$sisim = $_POST['sisim'];
$eposta = $_POST['eposta'];
$telefon = $_POST['telefon'];
$firma = $_POST['firma'];
$adres = $_POST['adres'];
$sehir = $_POST['sehir'];
$semt = $_POST['semt'];
$ulke = $_POST['ulke'];
$postakodu = $_POST['postakodu'];
$ip = GetIP();
$baglan=mysql_connect($host,$user,$psw);
mysql_select_db($db,$baglan) or die ("Veritabanı bağlantısı yok");
mysql_query("SET NAMES UTF8");
$yaz=mysql_query("INSERT INTO $tbl (paket,isim,siparisnu,kkod,sisim,eposta,telefon,firma,adres,sehir,semt,postakodu,ip) VALUES ('$paket','$isim','$siparisnu','$kkod','$sisim','$eposta','$telefon','$firma','$adres','$sehir','$semt','$postakodu','$ip')");
if(!$yaz){
echo "hata";
}
else{
echo ' <meta http-equiv="refresh" content="0;URL=onay.php?siparis=true">';
}
?>kaydedin ve tekrar çalıştırın.