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?

Recommended Answers

All 3 Replies

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

Sounds like you have whitespace somewhere there shouldn't be :)

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();
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.