prepare("update uyeler set " /> prepare("update uyeler set " /> Session'dan gelen veriyi güncelleme
Arama butonu
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
12
Cevap
355
Tıklama
0
Öne Çıkarma
Session'dan gelen veriyi güncelleme
S
5 yıl
Onbaşı
Konu Sahibi

<?php
if(!isset($_SESSION['eposta'])){
echo "<br/>
<br />
<br /><center>
<span class='hata'>Bu sayfayı görme yetkiniz yok.</span><br />
<br />
<br />";
header("location:index.php");
exit;
}
?>
<?
$id = "id";
if($id){

if($_POST){

$std = $_POST["std_id"];
$adi = $_POST["adi"];

$update = $db->prepare("update uyeler set

std_id=?,
adi=?
where id=?");

$ok = $update->execute(array($std,$adi,$id));
if($ok){
echo "<script>window.location = 'profil.php'</script>";
}else {

echo '<div class="alert alert-success">Profil güncelleme hatası.</div>';
}
}
?>
<div class="container">
<div class="row">
<br>
<br>
<form action="" method="post">

<div class="form-group col-md-2">
<label>Üye ID</label>
<input name="std_id" class="form-control" type="text" value="<? echo $_SESSION['std_id']; ?>"/>
</div>

<div class="form-group col-md-3">
<label>Üye Adı</label>
<input name="adi" class="form-control" type="text" value="<? echo $_SESSION['adi']; ?>"/>
</div>



Üstteki kodlara sessionlar geliyor. Fakat güncelleme yapamıyorum. Yardımlarınızı bekliyorum.