Cannot modify headers... when using OCI_Lob-> writeTemporary

Hello!

I use an installation of PHP4 came installed on the Oracle application server. The php page responds to an HTTP POST request and inserts the content of the request body into my database using oci8. I would return a 200 HTTP header if the insertion of the database succeeds, or 400 if it fails.

However, I run into error "cannot modify headers...". "where the header block has already been sent before that I try to put the status code. The culprit seems to be a function OCI_Lob-> writeTemporary, which I use to bind the string data received demand for a CLOB for insertion in my database. I wonder if there is any way to prevent the header sent, or any other way I could get the data string in my database that would allow me to avoid this error.

Here is my code

<? PHP
get the content of the HTTP POST request
$xml = @file_get_contents ('php://input');

Open the connection to the DB
$conn = ocilogon (user, pwd, host);

error, if it is unable to connect
If (! $conn) {}
trigger_error ("Could not connect to database", E_USER_ERROR);
}

build the query
$query is ociparse ($conn, "insert into XML_MESSAGE values (null, SYSDATE, null, XMLType(:clob), null, null)");.

Open the lob to store the xml file to insert
$lob = ocinewdescriptor ($conn, OCI_D_LOB);
$lob-> writeTemporary ($xml);
$lob-> close;

bind variables and run the query
ocibindbyname ($query, ': clob', $lob,-1, OCI_B_CLOB);
$success = ociexecute ($query);

Returns the status code
If {($success)
Header ("HTTP/1.0 200 OK");
}
else {}
Header ("HTTP/1.0 400 Bad Request");
}

Disconnection of the Oracle
ocilogoff ($conn);
? >



And here is the error:

WARNING: Cannot modify header information - headers already sent by (output started at c:\oracle\product\10.2.0\db\apache\apache\htdocs\test.php:18) in c:\oracle\product\10.2.0\db\apache\apache\htdocs\test.php on line 27

You probably have a text sent (maybe a mistake?) before setting the header:

$ php53 -r 'echo "something\n"; header("HTTP/1.0 200 OK");'
something
PHP Warning:  Cannot modify header information - headers already sent by (output started at Command line code:1) in Command line code on line 1

A good practice would be to set up a Manager error and/or the buffer output.

Tags: Database

Similar Questions

  • ORA-19504: cannot create file when using rman

    Hello
    on 10g bR2 on windows machine my rman backup failed on a drive mapped with following error message:
    ORA-19504: cannot create file when using rman

    What do you suggest me?

    I heard that RMAN cannot write to the mapped file system. Is this true? Some people proposed:

    OracleService must be run by OS user with permissions

    But what oracle service? Target or RMAN catalog database database?

    Thank you.

    You must change your environment, on metalink:

    How to configure RMAN to write about readers shared on Windows NT/2000
    DOC - ID: Note: 145843.1

    Werner

  • Others cannot hear me when using Skype

    original title: his record game

    Hi, I restart the week ago my computer and now I start using skypee I hear another voice of the person but they don't hear me.

    can u please tell me what to do I checked everything about the microphone.
    Thank you

    Hello

    You can check if you are able to record audio using the default recorder that comes with your pc.

    http://Windows.Microsoft.com/is-is/Windows7/record-audio-with-sound-recorder

    If it doesnot work, then you can try to troubleshoot your device microphone.

    http://support.Microsoft.com/kb/266677

  • Cannot send mail when using UTL_MAIL. Send

    Hello, I want to send a mail to oracle to yahoo, gmail...
    I had prvtmail.sql, utlmail.sql install and config alter system set smtp_out_server = 'MY PUBLIC IP' SCOPE = both;
    This is my code
    Start
    UTL_MAIL.SEND 
    ( sender => '[email protected]'
    , recipients => '[email protected]'
    , cc => null
    , subject => 'test'
    , message => 'this is a test');
    end;
    but it shows the error message
    Error report:
    ORA-29278: SMTP transient error: 421 Service not available
    ORA-06512: at "SYS.UTL_SMTP", line 20
    ORA-06512: at "SYS.UTL_SMTP", line 96
    ORA-06512: at "SYS.UTL_SMTP", line 138
    ORA-06512: at "SYS.UTL_MAIL", line 386
    ORA-06512: at "SYS.UTL_MAIL", line 599
    ORA-06512: at line 2
    29278. 00000 -  "SMTP transient error: %s"
    *Cause:    A SMTP transient error occurred.
    *Action:   Correct the error and retry the SMTP operation.
    Please help me
    Thank you

    Port 21 is FTP control port. The client and the server use a second tcp port to send data. If you open only port, the FTP client and server can communicate commands - but will be unable to send data (so downloading files and downloads will fail).

    Read this http://slacksite.com/other/ftp.html and pay particular attention to the functioning of the Passive and Active means and how do you determine the 2nd port (the data port used to send the data).

  • BRAVIA KDL-42W705B - cannot rename files when using HD recording

    I'm all round very happy with my new Sony TV. However, I spotted a missing feature: it doesn't seem to be a function to change the names of files in a already Harddisc recorded file. This is really needed - sometimes if the registered program starts a little later than planned, the file will automatically get its name from the previous thing that was on the same channel - causing great confusion after awhile when you forgot any file which is supposed to be that.

    Please consider this for a future update.

    Hello Mtxx,

    Unfortunately, we are unable to help customers outside the United States. Please recommend visiting our Sony Global Web site for more information on contacting the Sony's Support centre in your area at:http://www.sony.dk/ . Thank you-Richard

  • The equalizer settings cannot be changed when using radio... While with the other good music

    Someone had this problem? Play MP3/Vorbis/Wav (etc.) file and I can pass parameters e.q... Play the radio I can't switch e.q. settings.. What the?

    Your .mp3, etc are digital and so is the equalizer. The FM radio is analog; the Equalizer will not work on it.

  • When I try to compose an email, simply consist of window icon stuck in the taskbar windows cannot really expand and use it

    OK, the details of installation below, so when I try to compose an email, I just get a new message window icon stuck in windows
    taskbar cannot really expand and use it. If I reboot in safe mode with all the addons disabled, then it works fine. But
    If I restart normally and manually disable addons/plugins, then close and restart normally IE mode unsecured, it
    breaks, so doesn't seem to be an addon or plugin, but rather something with the configuration.

    Application Basics
    

    Name Thunderbird
    Version 31.6.0
    User Agent Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.6.0
    Profile folder
    See file
    (Local disk)
    Application version identifier 20150330093429
    Permit Plugins about: plugins
    Build configuration about: buildconfig
    Memory usage on: memory
    Mail and News accounts
    Outgoing server ID incoming servers
    Connection security name authentication security name connection default authentication method?
    Account2 (no) plain passwordCleartext of local records
    account3 (nntp) news.mozilla.org:119 passwordCleartext plain stbeehive.oracle.com:465 SSL passwordCleartext set to true
    account5 (imap) stbeehive.oracle.com:993 SSL stbeehive.oracle.com:465 SSL passwordCleartext true passwordCleartext
    Incident reports
    ID of the report
    BP-0a8986d2-ff0c-41C3-9da6-e770e2141224 24/12/2014
    BP-01f44ba7-3143-4452-AC98-981b62140123 23/01/2014
    Extensions
    Name enabled Version ID
    British English Dictionary 1.19.1 false [email protected]
    3.3.3 lightning {e2fda1a4-762b-4020-b5ad-a41df1933103} false
    Oracle Beehive Extensions for Thunderbird (OracleInternal) 1.0.0.5 false [email protected]
    Important change preferences
    Value name
    accessibility.typeaheadfind.flashBar 0
    Browser.cache.Disk.Capacity 358400
    Browser.cache.Disk.smart_size_cached_value 358400
    Fake Browser.cache.Disk.smart_size.first_run
    Fake Browser.cache.Disk.smart_size.use_old_max
    extensions.lastAppVersion 31.6.0
    fake font.internaluseonly.Changed
    make. Name.monospace.El Consolas
    font.name.monospace.tr Consolas
    make. Name.monospace.x - baltic Consolas
    make. Name.monospace.x - Central-euro Consolas
    make. Name.monospace.x - cyrillic Consolas
    make. Name.monospace.x - unicode Consolas
    make. Name.monospace.x - West Consolas
    make. Name.sans - serif.el Calibri
    font.name.sans - serif.tr Calibri
    make. Name.sans - serif.x - Baltic Calibri
    make. Name.sans - serif.x - Central-euro Calibri
    make. Name.sans - serif.x - cyrillic Calibri
    make. Name.sans - serif.x - unicode Calibri
    make. Name.sans - serif.x - western Calibri
    make. Name.Serif.El Cambria
    font.name.serif.tr Cambria
    make. Name.Serif.x - baltic Cambria
    make. Name.Serif.x - Central-euro Cambria
    make. Name.Serif.x - cyrillic Cambria
    make. Name.Serif.x - unicode Cambria
    make. Name.Serif.x - West Cambria
    make. Size.Fixed.El 14
    font.size.fixed.tr 14
    14 are. Size.Fixed.x - Baltic
    make. Size.Fixed.x - Central-euro 14
    14 are. Size.Fixed.x - cyrillic
    make. Size.Fixed.x - unicode 14
    14 are. Size.Fixed.x - West
    make. Size.variable.El 17
    font.size.variable.tr 17
    17 do. Size.variable.x - Baltic
    make. Size.variable.x - Central-euro 17
    17 do. Size.variable.x - cyrillic
    make. Size.variable.x - unicode 17
    17 do. Size.variable.x - West
    gfx.blacklist.Suggested - driver-version 257.21
    mail.openMessageBehavior.version 1
    true mail.winsearch.firstRunDone
    mailnews. Database.global.datastore.ID 8 d 997817 CEE1-4f16-aa36-008d5baeb30
    Mailnews. Fake Database.global.indexer.Enabled
    true network.cookie.prefsMigrated
    Network.TCP.sendbuffer 65536
    places.database.lastMaintenance 1429004341
    places. History.expiration.transient_current_max_pages 78789
    plugin.disable_full_page_plugin_for_types application/pdf
    true plugin.importedState
    plugin. State.Flash 0
    plugin. State.Java 0
    plugin. State.np32dsw 0
    plugin. State.npatgpc 0
    plugin. State.npctrl 0
    plugin. State.npdeployjava 0
    plugin. State.npfoxitreaderplugin 0
    plugin. State.npgeplugin 0
    plugin. State.npgoogleupdate 0
    plugin. State.npitunes 0
    plugin. State.npoff 0
    plugin. State.npqtplugin 0
    plugin. State.nprlsecurepluginlayer 0
    plugin. State.npunity3d 0
    plugin. State.npwatweb 0
    plugin. State.npwlpg 0
    true plugins.update.notifyUser
    Graphics
    Adapter Description NVIDIA Quadro FX 580
    Vendor ID 0x10de
    Device ID 0 x 0659
    RAM 512 MB card
    Adapter drivers nvd3dum nvwgf2um, nvwgf2um
    8.15.11.9038 driver version
    14/07/2009 driver date
    Active Direct2D blocked for your version of the graphics driver. Try to update your driver graphics version 257.21 or newer.
    Fake license DirectWrite (6.2.9200.16571)
    Gamma settings ClearType: 2200 Pixel Structure: R
    WebGL Renderer blocked for your version of the graphics driver. Try to update your driver graphics version 257.21 or newer.
    GPU accelerated Windows 0. Blocked for your version of the graphics driver. Try to update your driver graphics version 257.21 or newer.
    Skiing AzureCanvasBackend
    AzureSkiaAccelerated 0
    AzureFallbackCanvasBackend Cairo
    AzureContentBackend Cairo
    JavaScript
    Incremental GC 1
    Accessibility
    0 Active
    Prevent accessibility 0
    Versions of the library
    Minimum version expected Version in use
    NSPR 4.10.6 4.10.6
    NSS 3.16.2.3 ECC base 3.16.2.3 base ECC
    Util NSS 3.16.2.3 3.16.2.3
    NSS SSL 3.16.2.3 ECC base 3.16.2.3 base ECC
    S/MIME 3.16.2.3 NSS ECC base 3.16.2.3 base ECC

    Noticed in the information provided:
    Graphics adapt Description NVIDIA Quadro FX 580
    Vendor ID 0x10de
    Device ID 0 x 0659
    RAM 512 MB card
    Adapter drivers nvd3dum nvwgf2um, nvwgf2um
    8.15.11.9038 driver version
    14/07/2009 driver date
    Active Direct2D blocked for your version of the graphics driver.
    Try to update your driver graphics version 257.21 or newer.

    You can update your graphics driver and retest.

  • SDO_NN cannot be assessed without using the index when put inside subquery

    Hi all

    I met a problem when you use the function sdo_nn to find the nearest neighbor. Here is my scenario:

    _ I have 2 customer and store tables.

    Customer table _ a client_ID and a 2D sdo_geom point

    _ Store table has store_ID and a 2D polygon sdo_geom.

    In the beginning, I have this query to find the nearest store to each customer as below:

    Select s.STORE_ID, c.CLIENT_ID

    store customer, s c

    where sdo_nn (s.MYPOLYGON, c.MYPOINT, 'sdo_num_res = 1', 1) = "TRUE";

    _It works as expected when it returns a table showing the nearest store each customer.

    _Now I want to count the number of customers who have the same nearest store:

    Select / * + INDEX (store store_spatial_idx, client_spatial_idx client) * / count (nearest_store. CLIENT_ID)
    from (select s.STORE_ID, c.CLIENT_ID
    store customer, s c
    where sdo_nn (s.MYPOLYGON, c.MYPOINT, 'sdo_num_res = 1', 1) = "TRUE") nearest_store
    Group of nearest_store. STORE_ID;

    This query generates the following error:

    Error report-
    SQL error: ORA-13249: SDO_NN cannot be assessed without using the index
    ORA-06512: at the 'MDSYS. MD", line 1723
    ORA-06512: at the 'MDSYS. MDERR", line 17
    ORA-06512: at the 'MDSYS. PRVT_IDX', line 9
    13249 00000 - '%s '.

    I'm pretty new to spatial databases and hope get help to go further. Thank you in advance!

    Hello Pinball,

    Oracle space tends to be a quite complex with many variables and moving parts.  We chatted about the group to a sort of FAQ or guidelines to help people like you submit questions that actually answers.  First of all, you really have to tell us the version of Oracle you are using.  Particularly the problems involving the optimizer, version down to the exact defined patch number is a good idea.  Secondly, you took the time to submit the question so I guess you want a response.  If you really want to see the answer and then providing an example is one of the most important things that you can do.  I'm going to do here for you, but in general people on this forum come and go and are often pushed into lurkitude, so if you want the coax to provide you with an example of work is the key.

    DROP TABLE store1 PURGE;
    CREATE TABLE store1(
        store_id INTEGER NOT NULL
       ,shape    MDSYS.SDO_GEOMETRY
       ,PRIMARY KEY(store_id)
    );
    
    DROP TABLE client2 PURGE;
    CREATE TABLE client2(
        client_id INTEGER NOT NULL
       ,shape    MDSYS.SDO_GEOMETRY
       ,PRIMARY KEY(client_id)
    );
    
    CREATE OR REPLACE PROCEDURE seeder(
        p_client_count IN NUMBER
       ,p_store_count IN NUMBER
    )
    AS
      sdo_foo MDSYS.SDO_GEOMETRY;
      int_counter NUMBER;
      FUNCTION random_point
      RETURN MDSYS.SDO_GEOMETRY
      AS
          num_x1 NUMBER;
          num_y1 NUMBER;
    
      BEGIN
          num_x1 := dbms_random.value(-179,179);
          num_y1 := dbms_random.value(-89,89);
    
          RETURN MDSYS.SDO_GEOMETRY(
              2001
             ,8265
             ,MDSYS.SDO_POINT_TYPE(
                  num_x1
                 ,num_y1
                 ,NULL
              )
             ,NULL
             ,NULL
          );
    
      END random_point;
    
    BEGIN
      int_counter := 1;
      FOR i IN 1 .. p_client_count
      LOOP
          -- Create a client point
          sdo_foo := random_point();
          INSERT INTO client2
          VALUES (
              int_counter
             ,sdo_foo
          );
          int_counter := int_counter + 1;
    
      END LOOP;
    
      int_counter := 1;
      FOR i IN 1 .. p_store_count
      LOOP
          -- Create a store polygon of some kind
          sdo_foo := MDSYS.SDO_GEOM.SDO_ARC_DENSIFY(
              MDSYS.SDO_GEOM.SDO_BUFFER(
                  random_point()
                 ,5000
                 ,0.05
              )
             ,0.05
             ,'arc_tolerance=0.05'
          );
          INSERT INTO store1
          VALUES (
              int_counter
             ,sdo_foo
          );
          int_counter := int_counter + 1;
    
      END LOOP;
    
      COMMIT;
    
    END seeder;
    /
    
    BEGIN
      seeder(10000,200);
    END;
    /
    
    BEGIN
      INSERT INTO user_sdo_geom_metadata(
          table_name
         ,column_name
         ,diminfo
         ,srid
      ) VALUES (
          'STORE1'
         ,'SHAPE'
         ,MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,.05),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,.05))
         ,8265
      );
    
      COMMIT;
    
    EXCEPTION
      WHEN OTHERS
      THEN
          NULL;
    
    END;
    /
    
    BEGIN
      INSERT INTO user_sdo_geom_metadata(
          table_name
         ,column_name
         ,diminfo
         ,srid
      ) VALUES (
          'CLIENT2'
         ,'SHAPE'
         ,MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,.05),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,.05))
         ,8265
      );
    
      COMMIT;
    
    EXCEPTION
      WHEN OTHERS
      THEN
         NULL;
    
    END;
    /
    
    CREATE INDEX store1_spx ON store1
    (shape)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    NOPARALLEL;
    
    CREATE INDEX client2_spx ON client2
    (shape)
    INDEXTYPE IS MDSYS.SPATIAL_INDEX
    NOPARALLEL;
    
    /* Works as expected */
    SELECT
    s.store_id
    ,c.client_id
    ,MDSYS.SDO_NN_DISTANCE(1)
    FROM
    store1 s
    ,client2 c
    WHERE
    MDSYS.SDO_NN(
        s.shape
       ,c.shape
       ,'sdo_num_res=1'
       ,1
    ) = 'TRUE';
    
    /* No worky? Works for me */
    SELECT
    ns.store_id
    ,COUNT(ns.client_id)
    FROM (
       SELECT
        s.store_id
       ,c.client_id
       FROM
        store1 s
       ,client2 c
       WHERE
       MDSYS.SDO_NN(
           s.shape
          ,c.shape
          ,'sdo_num_res=1'
          ,1
       ) = 'TRUE'
    ) ns
    GROUP BY
    ns.store_id
    ORDER BY
    ns.store_id;
    

    So I wrote this about 12 c (12.1.0.2.0) and everything works fine for me.  Then I moved back from 11 GR 2 (11.2.0.4.0) and of course, there are questions.  So I guess that you don't use flavor of 11g.  So at this point we can look at the docs and see for 11g, have you often need to specify which table is the head and that is the one that has the spatial index to use.
    http://docs.Oracle.com/CD/E11882_01/AppDev.112/e11830/sdo_operat.htm#SPATL1032

    Its rather interesting that the optimizer of 12 c knows what you want, when I had to squint myself at your request and to play a little with the refining.  Note that SDO_NN is sensitive, because the geometry of the main table should come second in the operator.  I did not know that on the top of my head.

    
    SELECT
    /*+ LEADING(c) INDEX(s store1_spx)  */
     s.store_id
    ,c.client_id
    ,MDSYS.SDO_NN_DISTANCE(1)
    FROM
     store1 s
    ,client2 c
    WHERE
    MDSYS.SDO_NN(
        s.shape
       ,c.shape
       ,'sdo_num_res=1'
       ,1
    ) = 'TRUE';
    
    SELECT
     ns.store_id
    ,COUNT(ns.client_id)
    FROM (
       SELECT
       /*+ LEADING(c) INDEX(s store1_spx)  */
        s.store_id
       ,c.client_id
       ,MDSYS.SDO_NN_DISTANCE(1)
       FROM
        store1 s
       ,client2 c
       WHERE
       MDSYS.SDO_NN(
           s.shape
          ,c.shape
          ,'sdo_num_res=1'
          ,1
       ) = 'TRUE'
    ) ns
    GROUP BY
    ns.store_id
    ORDER BY
    ns.store_id;
    

    So I think that is your answer.  Give it a shot and see if this fits the Bill.  Of course, moving to 12 c would be useful for such things.  It would be interesting to collect more examples of this kind of space thing where 12 c is the answer. Also, would be nice if we could mark somehow this discussion as applying only to 11g and earlier versions.

    See you soon,.

    Paul

  • I have an account but cannot modify/use the tools.  I went from computers a week ago.  Help, please.

    I have an account but cannot modify/use the tools.  I went from computers a week ago.  Help, please.

    It should not, but you will need to download the right software to use. Adobe Acrobat Reader is what you are currently using. This is why you don't have the tools you are used to.

    Adobe Acrobat (not Reader), that's what you signed up for. He has the tools, you need and are a completely different, even if application you may have initially subscribed by using Adobe Acrobat Reader.

  • I get an error, "cannot view XML input using XSL sheet" when I try to install a mass storage driver.

    Original title: cannot view XML input using XSL sheet

    I can't install a mass storage driver. Message "Cannot view XML input using XSL sheet".
    Unspecified error.

    Hello

    I would have you post your query in the MSDN Forums, because it is addressed to an audience of it professionals.

    Your question would be more out there.

    Check out the link-

    http://social.msdn.Microsoft.com/forums/en-us/categories/

    Back to us for any issues related to Windows in the future. We will be happy to help you.

    Thank you.

  • WARNING: Cannot modify header information - redirects with the server behaviors

    I know it's an old question, but I can't find the answer.  I get an error when you use the update of the server behavior redirects the Add record  I get the error message: warning: cannot modify header information - headers already sent by (output began to...)

    I deleted as much white space before the header() function and I still get the error.

    <? php require_once('.. / Connections/Old4thDB.php');? >

    <? PHP

    If (! function_exists ("GetSQLValueString")) {}

    function GetSQLValueString ($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")

    {

    If (via 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 "set":

    $theValue = ($theValue! = "")? $theDefinedValue: $theNotDefinedValue;

    break;

    }

    Return $theValue;

    }

    }

    $editFormAction = $_SERVER ['PHP_SELF'];

    If (isset {}

    $editFormAction. = « ? ». htmlentities($_SERVER['QUERY_STRING']);

    }

    If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "UpdateVarietyForm")) {}

    $updateSQL = sprintf ("setting a DAY various SET varietyName = %s varietyType = %s varietyAlphaAcidGeneral = %s, varietyBetaAcidGeneral = %s, varietyOld4thAA = %s, varietyOld4thBA = %s, varietyEssenOil1 = %s, varietyEssenOil2 = %s, varietyEssenOil3 = %s, varietyEssenOil4 = %s, varietyEssenOil5 = %s, varietyEssenOil6 = %s WHERE variety_id = %s",

    GetSQLValueString ($_POST ['varietyName'], "text").

    GetSQLValueString ($_POST ['varietyType'], "text").

    GetSQLValueString ($_POST ['varietyAlphaAcidGeneral'], "text").

    GetSQLValueString ($_POST ['varietyBetaAcidGeneral'], "text").

    GetSQLValueString ($_POST ['varietyOld4thAA'], "text").

    GetSQLValueString ($_POST ['varietyOld4thBA'], "text").

    GetSQLValueString ($_POST ['varietyEssenOil1'], "text").

    GetSQLValueString ($_POST ['varietyEssenOil2'], "text").

    GetSQLValueString ($_POST ['varietyEssenOil3'], "text").

    GetSQLValueString ($_POST ['varietyEssenOil4'], "text").

    GetSQLValueString ($_POST ['varietyEssenOil5'], "text").

    GetSQLValueString ($_POST ['varietyEssenOil6'], "text").

    GetSQLValueString ($_POST ["'recordID"], "int"));

    @mysql_select_db ($database_Old4thDB, $Old4thDB);

    $Result1 = mysql_query ($updateSQL, $Old4thDB) or die (mysql_error ());

    $updateGoTo = "varieties.php";

    If (isset {}

    $updateGoTo. = (strpos ($updateGoTo, '?'))? « & » : « ? » ;

    $updateGoTo. = $_SERVER ['QUERY_STRING'];

    }

    header (sprintf ("location: %s", $updateGoTo));

    }

    @mysql_select_db ($database_Old4thDB, $Old4thDB);

    $query_rsUpdateVariety = "SELECT * FROM variety";

    $rsUpdateVariety = mysql_query ($query_rsUpdateVariety, $Old4thDB) or die (mysql_error ());

    $row_rsUpdateVariety = mysql_fetch_assoc ($rsUpdateVariety);

    $totalRows_rsUpdateVariety = mysql_num_rows ($rsUpdateVariety);

    ? >

    Am I missing other setups/configurations that could cause this?

    You forgot the most important part of the error message. "Output started at..." tells you where the production has started, guiding you to correct the error.

    The most common cause of this error is a space outside of an include file PHP tags. Most likely guilty is one or more new lines after the closing PHP tag in Old4thDB.php. Remove the closing tag PHP in this folder will be probably solved the problem.

    Another possible cause is using the BOM (byte order mark) on a PHP page. Make sure that the check box for the BOM is deselected in the Save dialog box.

  • WARNING: Cannot modify header information error

    This is the error i recieve when I use the log in system of my website. The session ID is correctly sent to the database and the form is processed.
    Although, when it comes to redirecting to the logged in homepage this error appears. I have tested this exact script with no problems in my computers local host.
    WHen uploaded online and tested tho the error appears. Please help!:
    Warning: Cannot modify header information - headers already sent by (output started at /home/gr/public_html/members_login_handle.php:6) in /home/gr/public_html/members_login_handle.php on line 97.
    
    The coding for the members_login_handle.php which processes my members_login.php form to login is below:
    
    <?php
    session_start();
    ?><!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"><!-- InstanceBegin template="/Templates/main_template.dwt" codeOutsideHTMLIsLocked="false" -->
    <head>
    <script type="text/javascript">
    <!--
    var message="";
    ///////////////////////////////////
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
    
    document.oncontextmenu=new Function("return false")
    // -->
    
    function disSel(target){
    if (typeof target.onselectstart!="undefined")
        target.onselectstart=function(){return false}
    else if (typeof target.style.MozUserSelect!="undefined")
        target.style.MozUserSelect="none"
    else
        target.onmousedown=function(){return false}
    target.style.cursor = "default"
    }
    </script>
    
    <script type="text/javascript">
    window.onload = function () {
    document.body.onselectstart = function () {
    return false;
    }
    document.body.ondragstart = function () {
    return false;
    }
    }
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>Staff Login</title>
    
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="seo" -->
    <meta name="Description" content="" />
    <meta name="Keywords" content="" />
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->    
    <link href="../stylesheets/main_styles.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
    <div id="wrap">
      <div id="header">
        <div id="logo"><a href="../index.php"><img src="../images/logo.gif" width="156" height="148" border="0" alt="img" title="Logo"/></a></div>
        Great Linford
      <br />Primary School</div>
      <div id="motto"><div id="myarea"><a href="../html_files/student_area.html" >My Area</a></div>
      Be proud to do the "Right Thing"
        
      <a href="../html_files/student_area.html"><img src="../images/star.gif" width="89" height="89" border="0" alt="img"/></a></div>
     
      <div id="menu">
      <ul>
      <li><a href="../index.php" accesskey="1">Homepage</a></li> 
       <li><a href="../html_files/school_tour.html" accesskey="2">School Tour</a></li> 
       <li><a href="../html_files/calendar.php" accesskey="3">Calendar</a></li>
       <li><a href="../html_files/newsletter.php" accesskey="4">Newsletter</a></li>
       <li><a href="../html_files/events.html" accesskey="5">Events</a></li>
        <li><a href="../html_files/parents.html" accesskey="6">Parents</a></li>
       <li><a href="../html_files/staff.html" accesskey="7">Staff</a></li>
        <li><a href="../html_files/contact_us.html" accesskey="8">Contact Us</a></li></ul>
      </div>
      <div id="content"><!-- InstanceBeginEditable name="page_content" -->
      <?php
    include_once('members_login_con.php');
    $id = $_REQUEST['id'];
    $pwd = md5($_REQUEST['pwd']);
    if(preg_replace('/[a-zA-Z0-9]/', '', $id)){
        echo "Invalid entry"; echo "<br>";
        echo "<a href=\"members_login.php\"><br />Please try again</a>.";
        }
        else{
    $check=mysql_query("SELECT * FROM users WHERE email = '".$id."' AND pwd = '".$pwd."'");
    $row_num=mysql_num_rows($check);
     if($row_num < 1){
        echo "The user name and/or password has been entered incorrectly.";    
        echo "<br />";
        echo "<br />";
        echo "Please <a href=\"members_login.php\">Try again</a>.";
    }else{
        $_SESSION['members'] = md5($_REQUEST['number']);
        $members = $_SESSION['members'];
        $_SESSION['id']=$id;
        $check = mysql_query("SELECT*FROM $table WHERE id= '".$id."' AND pwd = '".$pwd."'");
        $row_num = mysql_num_rows($check);
        if($row_num < 1){
            mysql_query("INSERT INTO $table (session,id,pwd) VALUES ('$members','$id','$pwd')");
            header('location:"members_area.php?sess='.$URLsession.'"');
        }else{
            echo "You are not authorised to log in concurrent sessions";
            echo "<br />";
            echo "<a href=\members_login.php\">Try again</a>";
        }
    }
    }
    ?>
    
    Thanks and can't wait to hear back with responses. Been trying to fix it for days...
    If any additional infomation is required I would be happy to provide it.
    Louise

    I wanted to say that you must move the entire block of code above server-side the head tags.

  • Cannot Modify Header Information error

    Hi all

    I working to build a members area only on my site and have used the "turorial" provided in dreamweaver help.  After you have created the pages but I meet erros that I think has to do with the redirect.

    On my registration page (www.hondovfd.org/newsite/register.php), I get the error:

    Warning: cannot modify header information - headers already sent in /var/home/hondovfd/hondovfd.org/www/newsite/register.php on line 50

    Registration passes by, as I can see it in my database, but the error prevented anything more.

    On my login page (www.hondovfd.org/newsite/login.php), I immediately get these two errors when the page is loaded:


    Warning: session_start() [Function.session - start]: Cannot send session cookie - headers already sent in /var/home/hondovfd/hondovfd.org/www/newsite/login.php on line 1074249146

    Warning: session_start() [Function.session - start]: Cannot send session cache limiter - already sent headers (output started at var/home/hondovfd/hondovfd.org/www/newsite/login.php:1074249146) in /var/home/hondovfd/hondovfd.org/www/newsite/login.php on line 1074249146

    And once I get a name of user and password valid this error is also added:

    Warning: cannot modify header information - headers already sent by (output started at var/home/hondovfd/hondovfd.org/www/newsite/login.php:1074249146) in /var/home/hondovfd/hondovfd.org/www/newsite/login.php on line 68

    If you want to try and diagnose the name of user and password that I use is 'test' for both fields.

    Someone has any ideas why this happens?

    Thank you

    David

    Take another look at what I wrote. You need to replace the path with a relative to the document. Yours is relative to the root of the site.

    PHP include and require constructions do not include site-relative links to the root. The include command should look like this:

    
    
  • PHP error: WARNING: cannot modify header information [...]


    Hello

    I just create a new page in dreamweaver (php server) to update a record, and the generated page gives the error:

    WARNING: Cannot modify header information - headers already [...]

    This happens after the update of the record, when it tries to access the page that I defined in the option "after updating, go to" Update Wizard. If looking at the code help, I put it in pastebinWeb site.

    Can you help me? Thanks in advance.

    Pedro

    PS - Yes, I'm a noob in PHP :-)

    ptknight wrote:
    > I don't see space before or after the php
    > tags. Is there anything else I should be looking? Would it be some parameters
    > or the fact that I write a text in PT (international characters)?

    The problem with spaces, it's that you can't see. The language
    you use is not important. This is something that is sent to the browser
    before the call to the header() function. Take a look at the PHP documentation on
    Header():

    http://www.php.net/manual/en/function.header.php

    The next section is particularly relevant:

    "Remember that header() must be called before any actual output is sent,
    either by normal HTML tags, blank lines in a file, or from PHP. It's a
    very frequent error to read code with include() or require() functions,
    or another file to access work and have spaces or empty lines that are
    output before header() function is called. The same problem exists when you use a
    simple PHP/HTML file.

    If you can't get the problem sorted, the answer is to put this right to
    at the top of your script:

    Also, you should put this right at the end of the page:

    This example gets around the problem of "headers already sent" by the buffering the
    output. Get rid of the problem by tracing his cause is best
    solution, however.

    --
    David powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • SQL error: ORA-01779: cannot modify a column that matches a key examine

    Hi all

    The requirement is that I have two tables s_party_d and S_CONTACT_d. the need to update the column name with FST_NAME | ',' | Last_name when column rowid in both tables are equal. I used the query previously below: -.

    Update
    (select
    E1. Name,
    e.FST_NAME,
    Select
    Of
    s_party_d e1,
    E S_CONTACT_d
    where
    E1. Game of ROW_ID = e.ROW_ID)
    name = FST_NAME | ',' | LAST_NAME;

    But I get the error message when executing the query

    Error in the command line: 31 column: 3
    Error report:
    SQL error: ORA-01779: cannot modify a column that is mapped to a table not preserved key
    01779 00000 - 'impossible to change a column that is mapped to a non-preserved table at key'
    * Cause: An attempt was made to insert or update columns in a join finds out who
    map to a table not kept the key.
    * Action: Change the directly underlying base tables.

    Can U please tell me why this error and how to solve?

    Thank you
    Mathon

    Mathon wrote:

    So, I have to look into some other method... I can't achieve this using a single update statement...

    Well, no matter what you do you need to decide what FST_NAME | ',' | Name to use. As I already pointed out for each line of the line of the s_party_d table there are several rows in table S_CONTACT_d. Again, you must yo decide what S_CONTACT_d table row you want to use. For example:

    update s_party_d e1
       set e1.name = (
                      select  max(e.FST_NAME) ||', '|| max(e.LAST_NAME)
                        from  S_CONTACT_d e
                        where e1.ROW_ID=e.ROW_ID
                     )
     where e1.ROW_ID in (
                         select  e.ROW_ID
                           from  S_CONTACT_d e
                        )
    /
    

    SY.

Maybe you are looking for

  • How can I correct the time on messages of a forum

    My messages for the ar15armory show a time of 6 hours after that I have validated

  • My mac disconnects constantly when you watch online stream video

    Hello My mac is a Macbook Pro (mid2014), OSX 10.11.3 (15 d 21). It disconnects literally every minute a when I play stream on douyutv.com (Chinese version of contraction). My other devices (pc, smartphone, pad) works well. I had an experience this fl

  • Tecra M9 requested user experiences

    Hello I am currently using a Satellite M30 and I think to purchase the Tecra M9. The tests are different. Some people are not satisfied with the screen, squeaky noise, quality of construction and the speakers.The comments are however contradictory on

  • Comparable apple music and all the missing playlists

    I have to unsubscribe from music to apple and all my playlists have disappeared. I spent hours to Prince to build, I'm not happy to hope can't find the function library Icloud music anywhere

  • HP Advisor version 3.2 for windows 7

    I have a HP Pavilion a6234x desktop computer and a Pavilion Elite m9040n and have just upgraded to Windows 7 from Windows Vista. Both have HP Advisor version 3.1 and it shows that I have no virus protection, even if I have Microsoft Security Essentia