Example #1
0
<?php

session_start();
require_once "_inc/db.php";
require_once "_inc/functions.php";
if (isset($_POST['GirisYapSubmit'])) {
    //üye giriş formunda gelen veriler
    $giris_kadi = formDegerAl($_POST['kadiGiris']);
    $giris_sifre = formDegerAl($_POST['sifreGiris']);
    $giris_sifre = md5($giris_sifre);
    if (!empty($giris_kadi) && !empty($giris_sifre)) {
        $sorguGiris = $db->prepare("SELECT * FROM uye WHERE kullaniciAdi = ? AND sifre = ? ");
        $sorguGiris->execute(array($giris_kadi, $giris_sifre));
        $rowGiris = $sorguGiris->fetch(PDO::FETCH_OBJ);
        if ($sorguGiris->rowCount() > 0) {
            $_SESSION['UyeID'] = $rowGiris->uyeID;
            header("Location:profil.php");
        } else {
            echo "<script>alert('Kullanıcı Adı veya şifre hatalı');</script>";
        }
    }
}
if (isset($_POST['uyeKayitSubmit'])) {
    //üye kayıt formundan gelen veriler
    $kullanici_adi = mysql_real_escape_string($_POST['kadi']);
    $eposta = mysql_real_escape_string($_POST['eposta']);
    $ad = mysql_real_escape_string($_POST['ad']);
    $soyad = mysql_real_escape_string($_POST['soyad']);
    $sifre = mysql_real_escape_string($_POST['sifre']);
    $sifretekrar = mysql_real_escape_string($_POST['sifretekrar']);
    //ip adresinin alınması
require "_inc/functions.php";
if (!isset($_SESSION['UyeID'])) {
    header("Location:index.php");
    exit;
} else {
    //üye girişi var ve form gönderilmişse
    if (isset($_POST['iletisimEkleSubmit'])) {
        $uyeID = $_SESSION['UyeID'];
        //iletişim ekle formundan gelen değerler
        $ulke = formDegerAl($_POST['ulke']);
        $sehir = formDegerAl($_POST['sehir']);
        $ceptel = formDegerAl($_POST['ceptel']);
        $evtel = formDegerAl($_POST['evtel']);
        $website = formDegerAl($_POST['website']);
        $facebook = formDegerAl($_POST['facebook']);
        $twitter = formDegerAl($_POST['twitter']);
        //ülke ve şehir bilgisinin boş olup olmadığı kontrolü
        if (empty($ulke) || empty($sehir)) {
            header("Location:profil-iletisim-ekle.php?Hata=AlanlarBos");
        } else {
            $sorguBaglantiEkle = $db->query("INSERT INTO uye_baglanti\n\t\t\t\t\t(uyeID,ulke,sehir,cepTelefon,evTelefon,website,facebook,twitter)\n\t\t\t\t\tVALUES\n\t\t\t\t\t('{$uyeID}','{$ulke}','{$sehir}','{$ceptel}','{$evtel}','{$website}','{$facebook}','{$twitter}')");
            if ($sorguBaglantiEkle->rowCount() > 0) {
                $sayfa = $_SERVER['PHP_SELF'];
                header("Location:{$sayfa}?Bilgi=BasariliKayit");
            }
        }
    }
}
?>

Example #3
0
 $row_DurumMesaj = $sorguDurumMesaj->fetch(PDO::FETCH_OBJ);
 $num_row_DurumMesaj = $sorguDurumMesaj->rowCount();
 //üye bağlantı kaydetme
 $sorguUyeBaglanti = $db->prepare("SELECT * FROM uye_baglanti WHERE uyeID = ? ");
 $sorguUyeBaglanti->execute(array($uyeID));
 $row_UyeBaglanti = $sorguUyeProfilResim->fetch(PDO::FETCH_OBJ);
 $num_row_uyeBaglanti = $sorguUyeBaglanti->rowCount();
 //profil oluşturma formu gönderildiğinde
 if (isset($_POST['uyeProfilOlusturSubmit'])) {
     echo "profl oluşturma formu gönderildi";
     //formdan gelen verilern alınması
     $ad = formDegerAl($_POST['ad']);
     $soyad = formDegerAl($_POST['soyad']);
     $dogumTarih = formDegerAl($_POST['dogumTarih']);
     $dogumYeri = formDegerAl($_POST['dogumYeri']);
     $yasadigiYer = formDegerAl($_POST['yasadigiYer']);
     //resmin adının alınması
     if (!empty($_FILES['resim']['name'])) {
         $resim = $_FILES['resim']['name'];
     } else {
         $resim = "profil-resim-yok.png";
     }
     //tablolara verilerin girilmesi
     $sorguUyeProfilOlustur = "INSERT INTO uye_profil\n\t\t\t(uyeID,ad,soyad,dogumTarih,dogumYeri,yasadigiYer,profilTarih)\n\t\t\tVALUES\n\t\t\t('{$uyeID}','{$ad}','{$soyad}','{$dogumTarih}','{$dogumYeri}','{$yasadigiYer}',NOW())\n\t\t\t";
     $sonucUyeProfilOlustur = $db->query($sorguUyeProfilOlustur);
     //$sonucUyeProfilOlustur->execute();
     if ($sonucUyeProfilOlustur) {
         //profil bilgileri girildi,resim yüklenecek
         $sorguProfilResim = "INSERT INTO uye_resim\n\t\t\t\t(uyeID,resim)\n\t\t\t\tVALUES\n\t\t\t\t('{$uyeID}','{$resim}')\n\t\t\t\t";
         $sonucResim = $db->query($sorguProfilResim);
         //$sonucResim->execute();