I have a classified site and when I try to add a listing through the site admin panel I get the following error:

Warning: Cannot modify header information - headers already sent by (output started at /home/n2ads/public_html/includes.php:292) in /home/n2ads/public_html/siteadmin/AddOffer.php on line 54

Can someone help me fix it?

Somewhere in the script something is being sent to the browser and then it's trying to redirect - and failing. given your lack of PHP skills (http://www.daniweb.com/techtalkforums/showthread.php?threadid=30089) you might be better trying to tackle the basics of PHP before trying to work your way through debugging this script.

The problem, however may be as simple as a space or blank line before the <?php in AddOffer.php

Sarah

Here is my AddOffer.php code can someone tell me where it is going wrong?

<?
require_once("conn.php");

if(isset($_POST[s1]))
{
    if(!empty($_FILES[images][name][0]))
    {
        while(list($key,$value) = each($_FILES[images][name]))
        {
            if(!empty($value))
            {
                $NewImageName = $t."_offer_".$value;
                copy($_FILES[images][tmp_name][$key], "re_images/".$NewImageName);

                $MyImages[] = $NewImageName;
            }
        }

        if(!empty($MyImages))
        {
            $ImageStr = implode("|", $MyImages);
        }

    }

    $catInfo = explode("|", $_POST[SelectCategory]);
    $CategoryID = $catInfo[0];
    $SubcategoryID = $catInfo[1];

    $q1 = "insert into re2_listings set 
                    AgentID = '$_SESSION[AgentID]',
                    CategoryID = '$CategoryID',
                    SubcategoryID = '$SubcategoryID',
                    address = '$_POST[address]',
                    city = '$_POST[city]',
                    state = '$_POST[state]',
                    country = '$_POST[country]',
                    ShortDesc = '$_POST[ShortDesc]',
                    DetailedDesc = '$_POST[DetailedDesc]',
                    Price = '$_POST[Price]',
                    PropertyType = '$_POST[PropertyType]',
                    image = '$ImageStr',
                    DateAdded = '$t' ";

    mysql_query($q1);

}

header("location:manage.php");
exit();
?>

Edited 3 Years Ago by pyTony: fixed formating

This article has been dead for over six months. Start a new discussion instead.