PHP - headers Already Sent Error

I Can't seem to get this page to redirect correctly after
deleting a record. Whatever I do a always get the headers already
sent error. I have looked but I can't find the reason. Can anyone
hep (code attached)
Cheers
Dave

davecheet wrote:
> I Can't seem to get this page to redirect correctly
after deleting a record.
> Whatever I do a always get the headers already sent
error. I have looked but I
> can't find the reason. Can anyone hep (code attached)
>
> <head>
> <?php require_once('../Connections/con_op.php');
?>
The fact that your PHP code is inside the head of the
document is
causing the problem. *No* output must be sent to the browser
before a
call to the PHP header() function.
Dreamweaver will not automatically place that code inside the
head. It's
something you must have done yourself. If you understand PHP
code, you
need to cut and paste it above the DOCTYPE. If you don't
understand PHP
code, you would be better off trying to create the page from
the start
again.
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/

Similar Messages

  • Headers already sent (includes/common/KT_functions.inc.php on line 464)

    Hello,
    I use a dynamic list wizard with ADDT for a backoffice. On my computer,with phpmyadmin, everything is ok and seems to be functional. But as soon as I upload my folders I got this error message :
    Warning: Cannot modify header information - headers already sent by (output started at /Library/WebServer/Documents/backoffice/Connections/connec.php:1) in /Library/WebServer/Documents/backoffice/includes/common/KT_functions.inc.php on line 464
    I checked my pages and didn't notice "white spaces" before or after php markup. I always got this problem.
    Anynone could help me ?
    Thanks

    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=12&catid=189&threadid =1332533

  • Headers already sent

    I have setup a require once file like this
    <br />
    <br />require_once("../Mobile_end/Dispatch_variables.php");
    <br />
    <br />to get this file with variables in it
    <br />
    <br /><?php<br /># FileName="Dispatch_variables.php"<br /># Type="php"<br /># HTTP="true"<br />$sms_list = array('0412489444', '0412083494', '0421085172', '0432024396','[email protected]');<br />?>
    <br />
    <br />On execution I get this error message
    <br />
    <br />Warning: Cannot modify header information - headers already sent by (output started at /home/webexped/public_html/Mobile_end/Dispatch_variables.php:2) in /home/webexped/public_html/includes/common/KT_functions.inc.php on line 464
    <br />
    <br />Whic seems to indicate that there is something wrong with my directory structure in the require_once statement.
    <br />
    <br />But I don't know what. Any suggestions? The file is there and it is being read.

    Hy Steve,
    <br />
    <br />Check if there is a line or character before "<?php" or after "?>" in your "Mobile_end/Dispatch_variables.php". Probably this is causing the error.
    <br />
    <br />Cheers
    <br />
    <br />Marcell

  • 'Headers Already Sent' causing problems

    Im trying to use cookies to create a login but I keep getting
    this warning:
    Warning: Cannot modify header information - headers already
    sent by (output started at
    /home/content/n/w/a/nwatkin03/html/includes/mysql_connect.php:9) in
    /home/content/n/w/a/nwatkin03/html/login.php on line 26, 27, 35

    Never mind, I had blank lines before the php tag in my
    'mysql_connect' file. All good now.

  • All new php code now sends the header already sent warning

    I have had none of these 'headers already sent....' problems
    creating php forms in the past with dreamweaver cs3 (on leopard).
    Now, every single php form generated using dreamweaver returns this
    warning - without fail. I copied the EXACT code from a working
    login form into a new page.....the new page, using the same include
    file is now returning the warning: I am pasting the code that
    works, and below that, the code that does not work. Even Developer
    Toolkit, on the rare occasion it doesn't cause DW to crash, seems
    to be inserting code that does not work properly - same goes for
    the insert > data objects.
    I've attached the code from both pages - page that works at
    the top, page that doesn't work at the bottom:

    debrankin55 wrote:
    > I have had none of these 'headers already sent....'
    problems creating php forms
    > in the past with dreamweaver cs3 (on leopard). Now,
    every single php form
    > generated using dreamweaver returns this warning -
    without fail.
    Select Modify > Page Properties, and check Title/Encoding.
    Make sure
    that Include Unicode Signature (BOM) is deselected.
    If that doesn't do the trick, select View > Code View
    Options > Hidden
    Characters. Make sure there aren't any rogue characters
    outside the PHP
    tags, both in the affected page and any include file.
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS3" (friends of
    ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • Header already sent

    Hello,
    Please excuse me. I know this has been discussed before. I am trying to make a simple user registration form. When the submit botton is pressed I always seem to get
    "Warning: Cannot modify header information - headers already sent in C:\xampp\htdocs\cdlist\Untitled-1.php on line 45"
    The main code is:
    <?php virtual('/cdlist/Connections/cdlist.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO users (username) VALUES (%s)",
                           GetSQLValueString($_POST['name'], "text"));
      mysql_select_db($database_cdlist, $cdlist);
      $Result1 = mysql_query($insertSQL, $cdlist) or die(mysql_error());
      $insertGoTo = "yes.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s",$insertGoTo));
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
      <table width="500" border="1">
        <tr>
          <td>cd name
            <label>
              <input type="text" name="name" id="name" />
              <input type="submit" name="button" id="button" value="Submit" />
          </label></td>
        </tr>
        <tr>
          <td>cd type 
            <label>
              <input type="text" name="type" id="type" />
              <input type="reset" name="button2" id="button2" value="Reset" />
          </label></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    </body>
    </html>
    The associated file for the main page cdlist.php is :
    <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_cdlist = "localhost";
    $database_cdlist = "one_stop";
    $username_cdlist = "root";
    $password_cdlist = "enterprise";
    $cdlist = mysql_pconnect($hostname_cdlist, $username_cdlist, $password_cdlist) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>
    The page that should come up is given by
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    yes it was inserted
    </body>
    </html>
    I really have tried to find the solution and I really don't understand why this doesn't work. Please, any help would be really appreciated.
    Thanks

    <?php include($_SERVER['DOCUMENT_ROOT'].'/cdlist/Connections/cdlist.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO users (username) VALUES (%s)",
                           GetSQLValueString($_POST['name'], "text"));
      mysql_select_db($database_cdlist, $cdlist);
      $Result1 = mysql_query($insertSQL, $cdlist) or die(mysql_error());
      $insertGoTo = "yes.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      header(sprintf("Location: %s",$insertGoTo));
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    <form id="form1" name="form1" method="POST" action="<?php echo $editFormAction; ?>">
      <table width="500" border="1">
        <tr>
          <td>cd name
            <label>
              <input type="text" name="name" id="name" />
              <input type="submit" name="button" id="button" value="Submit" />
          </label></td>
        </tr>
        <tr>
          <td>cd type 
            <label>
              <input type="text" name="type" id="type" />
              <input type="reset" name="button2" id="button2" value="Reset" />
          </label></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    </body>
    </html>
    Thanks for the reply David. Here is Untitled-1.php. As you can can see I have edited the first line to the suggested include code.

  • I just bought a iTunes card and its not accepting it.  It already sent it to the support team and they said they were going to get back to my within 24 hours and i am trying to buy a program in the app store for work.  How can I expedite this process?

    I just bought a iTunes card and its not accepting it.  It already sent it to the support team and they said they were going to get back to my within 24 hours and i am trying to buy a program in the app store for work.  How can I expedite this process?

    Has it been 24 hours?
    I take it this was a gift card.  iTunes Store:  Invalid, Inactive, or Illegible codes http://support.apple.com/kb/TS1292 - gift cards
    I don't know if this provides an alternative means: https://expresslane.apple.com ; select 'iTunes' in the first column; 'iTunes Store' in the second column
    If you are really desperate you could buy the app yourself, then request reimbursement.

  • I deleted my foxfire profile contents and now get firefox is already running error. reinstall did not help

    I deleted the contents of my profile. Now i get the firefox is already running error. i realize that i screwed up. i have restarted, uninstalled, reinstalled, but still firefox will not load.

    You can get that error if Firefox can not find the profile folder. For details on what to check see http://kb.mozillazine.org/Profile_in_use

  • I lost my iphone, and know where it is through icloud, how do i get my phone back? i already sent lost phone, and where to call and he or she does not want to call. what I do I lost it yesturday?

    I lost iphone yeturday, and know where it is using icloud, how do  I get it back?  I already sent a lost phone to my phone an I said to call me at a number i can be reached at.  He or she dose not want to call. What am I to do?

    Hard to know, but reporting it to the police is usually a required step from your insurance carrier if you plan on filing a claim.  Here's Apple's support article on what to do: http://support.apple.com/kb/HT5668.

  • Getting Object already exist error when installing adobe reader

    I'm unable to install any Adobe application programs on my Windows 7 machine.  I tried Adobe Reader XI, Lightroom 5.6, Photoshop CC, etc.  All resulted with "Object Already Exist" error.  I searched on Adobe site for fix, and there was one to delete Crypto file.  However, this resulted with the same error.  How can I install Adobe Reader?

    Your approach is correct in identifying the error.  I used ProcMon from Sysinternals (now Microsoft) and came up with the following events leading up to "Object already exists" error.  The error occurs after opening C:\Users\%account%\AppData\Crypto\RSA\S-1-5-....... file.  If the Crypto directory is missing, MSIEXEC.EXE will create along with RSA subdirectory and file name starting with S-1-5.....  There were five NAME NOT FOUND events, and their sequence is
         Windows Installer Logging item in HKLM\SOFTWARE registry
         C:\Users\%account%\AppData\Local\Temp\MSI7058d.LOG (this file was created at the next step)
         Windows Installer Debug item in HKLM\SOFTWARE registry
         FontSubstitution in HKLM\SOFTWARE registry
         CTF Known Classes item in HKLM|SOFTWARE registry
    I don't know which one causing the error, but my suspicion is the last one. But I don't know how to fix it.  Is there anyone who can give me insight to what is happening and how to fix it?

  • Folder name already exists error when activating feature

    HI,
    I am creating a document library and adding folders to it using elements.xml in VS 2012.
    First time deployment of the item works fine, the folder is created. But further deployment or activation of feature from site features is throwing the error "Folder name already exists".
    Below is the elements.xml of List Instance, which was modified to add the folders.
    <ListInstance Title="TestLibrary" OnQuickLaunch="FALSE" TemplateType="101" FeatureId="Guid" Url="Lists/TestLibrary" Description="TEST Library List Instance">
    <Data>
    <Rows>
    <Row>
    <Field Name="ContentTypeId">0x0120004F994A3C0FF76546A528DA0D4B515898</Field>
    <Field Name="FileLeafRef">Test_One</Field>
    <Field Name="Title">Test_One</Field>
    <Field Name="FSObjType">1</Field>
    </Row>
    <Row>
    <Field Name="ContentTypeId">0x0120004F994A3C0FF76546A528DA0D4B515898</Field>
    <Field Name="FileLeafRef">Test_Two</Field>
    <Field Name="Title">Test_Two</Field>
    <Field Name="FSObjType">1</Field>
    </Row>
    </Rows>
    </Data>
    </ListInstance>
    How to fix this?
    Thanks

    Hi,
    According to your post, my understanding is that you got “Folder name already exists error when activating feature”.
    I had used the following code snippet to create a folder within a document library, it didn’t throw errors when reactive the feature.
    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <ListInstance Title="LibTest"
    OnQuickLaunch="TRUE"
    TemplateType="10000"
    Url="Lists/LibTest"
    Description="My Lib Instance">
    </ListInstance>
    <Module Url="Lists/LibTest/Folder1" />
    </Elements>
    http://shareden.blogspot.com/2012/11/creating-feature-with-image-library.html
    Also, when you redeploy the project, it will give you a dialog which would promote to delete the existed list or not.
    If you click the “Resove Automatically”, the visual studio would delete the existed list automatically, and create a new list.
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

  • How can i see the images that i've already sent in bbm with the description that i did??

    Hello!, i can't see the description of the images that i've already sent by bbm. Is any way to see that???. Any app for that??. Please i need help!

    If you mean your iCloud backup, you can't see the individual files contained in the backup.  You can only access the data in the backup by restoring it to your device.
    You can see categories of data stored in your iCloud account by going to Settings>iCloud>Storage & Backup>Manage Storage.  You can see the actual data by looking in the apps on your device that are syncing data with iCloud (contacts, calendars, notes, etc.).  You can also see some of this data by going to icloud.com from your comptuer.

  • Php-cgi.exe - Application Error when Oracle is connected in PHP

    I am connecting Oracle 10g from PHP 5.0 and my OS is win server2003. I uncommented the following line in php.ini file also.
    extension=php_oci8.dll
    It is connecting the oracle and giving the required result also, but everytime the following error is coming.
    php-cgi.exe - Application Error
    The instruction at "0x6067b97e" referenced memory at "0x0114f020". The memory could not be read.
    Click OK to terminate the program.
    Click CANCEL to debug the program.
    Can anyone suggest to rectify this?

    Are you using a php_oci8.dll that is the right version for the version of php you're using? I know that sounds silly, but sometimes people do that.
    ~Jer

  • I didn't receive any news about the replacement program for the Ipod 1st generation. I have already sent the serial number online, but didn't have any progress. What should I do? Thank you

    I didn't receive any news about the replacement program for the Ipod 1st generation. I have already sent the serial number online, but didn't have any progress. What should I do? Thank you

    After you set up your service use your repair ID to track your replacement here:
    https://selfsolve.apple.com/repairstatus/main.do
    Remember: You will receive a replacement unit approximately 6 weeks after Apple gets your current iPod nano
    Hope this helps.
    -Julian

  • I'm getting an 'objects already exist' error when trying to download itunes

    My iPhone 6 wouldn't connect to iTunes since it need to update. So I went to uninstall iTunes and all it's contents. I went to download iTunes again, but when I did I received an 'Object already exists' error. I went to look at more information on the Apple website and I tried everything I could but I keep receiving the error. I uninstalled anything related to Apple on my computer and I went to the Program Files folder on my computer and found nothing related to Apple so I'm pretty sure I deleted all the data already. I really need help with this. I have a Windows 7 computer.

    For "Object already exists" or "Access denied" errors when installing try opening Control Panel > Programs and Features > View installed updates then checking for Security Update for Microsoft Windows (KB2918614). Uninstall if you have it, then reboot and try installing again.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for performance issues.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

Maybe you are looking for

  • A página Firefox - histórico, entre outros está em outro idioma... como posso alterar?

    A página está em inglês e gostaria de alterar para o português

  • XML Publisher Enterprise Edition's report errors

    I have installed XML Publisher Enterprise Edition.when i open it through explorer i can see it's different folder that also have some report as Executive,Financials,HR Manager,Sales Manager,Warehouse Managment.when i try to open reports under these f

  • Acrobat 9 will not convert html

    While running Acrobat Pro 9 and using I.E. 7 I tried to convert a web page to .pdf and all I get is a garbled pdf page. I have lowered the security setting in I.E. to medium but this does nothing. A couple weeks ago I was able to convert a web page t

  • Connect External Monitor

    Sometimes when I have connected an external monitor it has worked, other times not. I am now finding it impossible to get it to work at all. I am connecting to a CRT Monitor through a firewire connection to a Sony FX1 Camera and then by SVHS to the M

  • Any way to create extended markers in Premiere Pro CC 2014.1???

    One of the great features of FCP7 was that it allowed us to create extended markers. I'm currently viewing a long documentary interview and I'd like to be able to set extended markers rather than simple markers. Is there any way to do this in latest