www.webdeveloper.com
Results 1 to 2 of 2

Thread: Dose anyone tell me what this mean...

  1. #1
    Join Date
    Aug 2006
    Posts
    57

    Dose anyone tell me what this mean...

    I'm trying to delete image from database using id number and image id number like "image_1, image_2 etc...

    There is button where to press button to send php to delete images

    <button class="test"> <a href='edit-product.php?yesdelete=$images_2'>delete</a></button>

    when i pressed button i'm getting error message said

    Warning: Cannot modify header information - headers already sent by (output started at C:\VertrigoServ\www\shopone\admin\data\products\edit-product.php:266) in C:\VertrigoServ\www\shopone\admin\data\products\edit-product.php on line 280

    That delete code is


    PHP Code:
    <?php 
    // Delete Item Question to Admin, and Delete Product if they choose

    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 product WHERE images_2='$id_to_delete' LIMIT 1") or die (mysql_error());
        
    // unlink the image from server
        // Remove The Pic -------------------------------------------
        
    $pictodelete = ("../product_images/$id_to_delete.jpg");
        if (
    file_exists($pictodelete)) {
                       
    unlink($pictodelete);
        }
        
    header("location: product-copy-4.php"); 
        exit();
    }
    ?>

    The error line number 260 is where it said

    // delete from database

    and line number 280 is after end of ?> code.

    does anyone can help me what is mean and how to solve that please!

    AM

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,241
    It means something has already sent output to the browser before you got to your header() command, so you can no longer send HTTP headers. The error message say that output was generated at line 266.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles