üncelleme işlemini yapmıyor her şey açılıyor ama ölece kalıyor işte kodları:
Duzenle.php
Kod:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<H2>
<font color=#c00020 >Güncelleme (değiştirme) İşleminizi Buradan Yapabilirsiniz:</font>
<H2>
<?php
$ID=$_GET["ID"];
include('ayar.php');
$sorgu=mysql_query("select * from mesajlar where ID=$ID");
while ($kayit=mysql_fetch_array($sorgu)) {
$isim=$kayit['isim'];
$soyad=$kayit['soyad'];
$email=$kayit['email'];
$mesaj=$kayit['mesaj'];
echo '<form name="form1" method="post" action="Duzenle2.php?ID='.$ID.'">
<table width="302" border="0">
<tr>
<td width="122" "><B>İsim:</B></td>
<td width="244"><label>
<input type="text" name="isim" id="isim" value="'.$isim.'">
</label></td>
</tr>
<tr>
<td "><B>E-mail:</B></td>
<td><input type="text" name="email" id="email" value="'.$email.'"></td>
</tr>
<tr>
<td "><B>Mesaj:</B></td>
<td><input type="text" name="mesaj" id="mesaj" value="'.$mesaj.'"></td>
</tr>
<tr>
<td> </td>
<td><div align="right">
<label>
<input type="submit" name="button" id="button" value="Güncelle">
</label>
</div></td>
</tr>
</table>
</form>';
}
?>
<form action="mesajoku.php" method="post">
<input type="submit" value="Geri Dön">
<html>
<body bgcolor="#D3EEF7" />
</html>
Duzenle2.php
Kod:
<?php ob_start(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
$ID=$_GET["ID"];
$isim=$_POST["isim"];
$soyad=$_POST["soyad"];
$mesaj=$_POST["mesaj"];
$email=$_POST["email"];
include("ayar.php");
$Komut=mysql_query("update mesajlar set Ad='$isim', Soyad='$soyad', email='$email', mesaj='$mesaj' where ID=$ID");
if($Komut){
echo "Kaydınız başarıyla güncellenmiştir.<br>Lütfen bekleyin yönlendiriliyorsunuz.";
header("refresh:2; url=mesajoku.php");
}
else{
echo "Bir sorunla karşılaşıldı!<br>Lütfen bekleyin yönlendiriliyorsunuz.";
header("refresh:2; url=mesajoku.php");
}
?>
<?php ob_end_flush(); ?>
Duzenle.php
Kod:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<H2>
<font color=#c00020 >Güncelleme (değiştirme) İşleminizi Buradan Yapabilirsiniz:</font>
<H2>
<?php
$ID=$_GET["ID"];
include('ayar.php');
$sorgu=mysql_query("select * from mesajlar where ID=$ID");
while ($kayit=mysql_fetch_array($sorgu)) {
$isim=$kayit['isim'];
$soyad=$kayit['soyad'];
$email=$kayit['email'];
$mesaj=$kayit['mesaj'];
echo '<form name="form1" method="post" action="Duzenle2.php?ID='.$ID.'">
<table width="302" border="0">
<tr>
<td width="122" "><B>İsim:</B></td>
<td width="244"><label>
<input type="text" name="isim" id="isim" value="'.$isim.'">
</label></td>
</tr>
<tr>
<td "><B>E-mail:</B></td>
<td><input type="text" name="email" id="email" value="'.$email.'"></td>
</tr>
<tr>
<td "><B>Mesaj:</B></td>
<td><input type="text" name="mesaj" id="mesaj" value="'.$mesaj.'"></td>
</tr>
<tr>
<td> </td>
<td><div align="right">
<label>
<input type="submit" name="button" id="button" value="Güncelle">
</label>
</div></td>
</tr>
</table>
</form>';
}
?>
<form action="mesajoku.php" method="post">
<input type="submit" value="Geri Dön">
<html>
<body bgcolor="#D3EEF7" />
</html>
Duzenle2.php
Kod:
<?php ob_start(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
$ID=$_GET["ID"];
$isim=$_POST["isim"];
$soyad=$_POST["soyad"];
$mesaj=$_POST["mesaj"];
$email=$_POST["email"];
include("ayar.php");
$Komut=mysql_query("update mesajlar set Ad='$isim', Soyad='$soyad', email='$email', mesaj='$mesaj' where ID=$ID");
if($Komut){
echo "Kaydınız başarıyla güncellenmiştir.<br>Lütfen bekleyin yönlendiriliyorsunuz.";
header("refresh:2; url=mesajoku.php");
}
else{
echo "Bir sorunla karşılaşıldı!<br>Lütfen bekleyin yönlendiriliyorsunuz.";
header("refresh:2; url=mesajoku.php");
}
?>
<?php ob_end_flush(); ?>