i güncelleme formu üzerinde çalışmak için çalışıyordu ben yanlış bir şey olduğunu gördük. Form iyi çalışıyor ama yeni veri veritabanına eklemek ama URL görünmüyor
code :
include"connection.php";
$gid = intval($_GET['id']);
$id = $_POST['product_id'];
$content = $_POST['content'];
$link = $_POST['link'];
if(isset($_POST['saveedit']) && $_POST['saveedit']=='products'){
$update = mysql_query(" UPDATE products SET
content='$content',
link='$link'
WHERE product_id='$id' ") or die (mysql_error());
if(isset($update)){
echo "<b>update is done</b>";
}
}
$query = mysql_query(" SELECT * FROM products WHERE product_id='".$gid."' ") or die (mysql_error());
$re = mysql_fetch_assoc($query);
if($_REQUEST['do'] == 'edit'){
echo"
<form action='".$_SERVER['PHP_SELF']."' metho='post'>
<table>
<tr>
<td>Link : </td>
<td><input type='text' name='link' value='".$re['link']."'/></td
</tr>
<tr>
<td>Content :</td>
<td><textarea name='content'>".$re['content']."</textarea></td>
</tr>
<tr>
<td colspan='2'>
<input type='submit' name='saveedit' value='save'/>
<input type='hidden' name='id' value='".$gid."'/>
<input type='hidden' name='productedit' value='products'/>
</td>
</tr>
</table>
</form>
";
}
$data = mysql_query("SELECT * FROM products ORDER BY product_id");
echo"
<table width='500' border='1'>
<tr>
<td>Link</td>
<td>Content</td>
<td>Option</td>
</tr>
";
while($row = mysql_fetch_assoc($data)){
echo"
<tr>
<td>".$row['link']."</td>
<td>".$row['content']."</td>
<td>
<a href='edit.php?do=edit&id=".$row['product_id']."'> Edit </a>
</td>
</tr>
";
}
echo"</table>";
>