so i have a zoom.php where i have a link.
<a href='deleteimage.php?imgid={$row['image_id']}'>Delete</a>
if user click on it it goes to deleteimage.php where i have a form. in form i have field where i store imagid.
<form class="form" action = 'deleteimage.php' method = 'post'>
<input type='submit' class='button' value='Yes'>
<input type="hidden" name ="random" class="random" value="<?php echo($_GET['imgid']);?>" />
<br/><br/>
<br/>
<br/>
</form>
now if user click on submit button it run php code. note its still on deleteimage.php page.
if(isset($_SESSION['username'])) /*** user is loged in ***/
{
if($_SERVER['REQUEST_METHOD'] == 'POST') //user hit submit button
{
$user_id_s = $_SESSION['user_id'];
$image_id_g = $_POST['random'];
if(!$tester = mysql_query("SELECT * FROM image WHERE image_id = '$image_id_g' AND user_id = '$user_id_s'"))
{
$del_image = mysql_query("DELETE FROM image WHERE image_id = '$image_id_g'");
$del_comment = mysql_query("Delete From comment Where image_id = '$image_id_g'");
}
here i get a error. and have no idea who to fix it.
<br /><b>Notice</b>: Undefined index: imgid in <b>C:\xampp\htdocs\a_upload\deleteimage.php</b> on line <b>51</b><br />
note. line 51 is:
<input type="hidden" name ="random" class="random" value="<?php echo($_GET['imgid']);?>" />