Jump to content

Notice: Undefined variable: GET


co.ador

Recommended Posts

I don't know why I am getting an undefined variable when the url is define. look at the deleteid=6 it means it is defined and in the code it is written as below

 

URL


<?php 
if(isset($_GET['deleteid'])){ //which is clearly active in the url then get it, 

/* line 27 ===> */   echo'Do you really want to delete pdoruct with ID of '. $GET ['deleteid'] . '? <a href="inventory_list.php?yesdelete=' . $GET ['deleteid'] .   '">Yes</a> |<a href="inventory_list.php"> No</a>';
exit();
}
if (isset($_GET['yesdelete'])) {
// remove item from system and delete its picture
// delete from database
$id_to_delete = $_GET['yesdelete'];
$sql = mysql_query("DELETE FROM products WHERE id='$id_to_delete' LIMIT 1") or die (mysql_error());
// unlink the image from server
// Remove The Pic -------------------------------------------
    $pictodelete = ("../inventory_images/$id_to_delete.jpg");
    if (file_exists($pictodelete)) {
       		    unlink($pictodelete);
   
}
header("location:inventory_list.php"); 
    exit();
}

?>

 

the echo

<?php echo 'Do you really want to delete pdoruct with ID of '. $GET ['deleteid'] . '? <a href="inventory_list.php?yesdelete=' . $GET ['deleteid'] .  '">Yes</a> |<a href="inventory_list.php"> No</a>'; ?>

won't display the . $GET ['deleteid'] .  after "Do you really want to delete product with ID of which is 6 but it won't display the number six with the actual configuration, instead it display it like

 

Notice: Undefined variable: GET in /home3/nyhungry/public_html/storeprueba/storeadmin/inventory_list.php on line 27

 

Notice: Undefined variable: GET in /home3/nyhungry/public_html/storeprueba/storeadmin/inventory_list.php on line 27

Do you really want to delete pdoruct with ID of ? Yes | No

 

Notice not number in between 'ID of'  and '?'

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.