3 Replies Latest reply on Jul 23, 2007 4:52 AM by RichMariner

    Cannot modify header information ...

      Just installed Dreamweaver with Developer Toolbox and tested the following simple sites on different Webservers (in Internet and on local machines) with Apache, PHP and mySQL:

      * Upload include-folder
      * create user table in mySQL database
      * create registration- and login-page with Toolbox-wizzards

      Registration page writes data in database, login-page does not work and interrupts with the following errors:

      - 8< -----------------------------------------------------------------

      Warning: Cannot modify header information - headers already sent by (output started at [webserver-folders]/html/login.php:1) in [webserver-folders]/includes/tng/triggers/tNG_defTrigg.inc.php on line 524

      Warning: Cannot modify header information - headers already sent by (output started at [webserver-folders]/html/login.php:1) in [webserver-folders]/includes/tng/triggers/tNG_defTrigg.inc.php on line 527

      Warning: Cannot modify header information - headers already sent by (output started at [webserver-folders]/html/login.php:1) in [webserver-folders]/includes/common/KT_functions.inc.php on line 464

      - 8< ------------------------------------------------------------------

      Warning #1 and #2 occurs, if "Remember me" (Cookie) is checkmarked, Warning #3 always occurs.

      In the site settings, hyperlinks are set relative to the document (but I thried the other setting as well with no success. Similar errors with Adobe Developer Toolbox occur with other wizzards. With DW8 and Interakt Tools those pages worked fine.

      Is there a wrong setting? May I expect an update?

      Any help is appreciated.

      Many thanks and regards
      Norbert
        • 1. Re: Cannot modify header information ...
          Günter Schenk Level 4
          Hi Norbert,

          can you please post your login page´s code ? However, such "headers already sent" error messages can very often be caused by an empty line after the last line of php and before the  tag

          Günter Schenk
          Adobe Community Expert, Dreamweaver
          • 2. Re: Cannot modify header information ...
            Level 1
            Cannot modify header information ... <br /> <br />Hello Günter, <br /> <br />attached you find the login.php. <br /> <br />Thanks for your help! <br /> <br />Kind regards <br />Norbert <br /> <br />--------------------------------------------------------------- <br /><?php require_once('../Connections/kohlhauer.php'); ?> <br /><?php<br />// Load the common classes<br />require_once('../includes/common/KT_common.php');<br /><br />// Load the tNG classes<br />require_once('../includes/tng/tNG.inc.php');<br /><br />// Make a transaction dispatcher instance<br />$tNGs = new tNG_dispatcher("../");<br /><br />// Make unified connection variable<br />$conn_kohlhauer = new KT_connection($kohlhauer, $database_kohlhauer);<br /><br />// Start trigger<br />$formValidation = new tNG_FormValidation();<br />$formValidation->addField("kt_login_user", true, "text", "", "", "", "");<br />$formValidation->addField("kt_login_password", true, "text", "", "", "", "");<br />$tNGs->prepareValidation($formValidation);<br />// End trigger<br /><br />// Make a login transaction instance<br />$loginTransaction = new tNG_login($conn_kohlhauer);<br />$tNGs->addTransaction($loginTransaction);<br />// Register triggers<br />$loginTransaction->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "kt_login1");<br />$loginTransaction->registerTrigger("BEFORE", "Trigger_Default_FormValidation", 10, $formValidation);<br />$loginTransaction->registerTrigger("END", "Trigger_Default_Redirect", 99, "{kt_login_redirect}");<br />// Add columns<br />$loginTransaction->addColumn("kt_login_user", "STRING_TYPE", "POST", "kt_login_user");<br />$loginTransaction->addColumn("kt_login_password", "STRING_TYPE", "POST", "kt_login_password");<br />$loginTransaction->addColumn("kt_login_rememberme", "CHECKBOX_1_0_TYPE", "POST", "kt_login_rememberme", "0");<br />// End of login transaction instance<br /><br />// Execute all the registered transactions<br />$tNGs->executeTransactions();<br /><br />// Get the transaction recordset<br />$rscustom = $tNGs->getRecordset("custom");<br />$row_rscustom = mysql_fetch_assoc($rscustom);<br />$totalRows_rscustom = mysql_num_rows($rscustom);<br />?> <br /> <!-- InstanceBegin template="/Templates/master.dwt.php" codeOutsideHTMLIsLocked="false" --> <br /> <br /> <br /> <!-- InstanceBeginEditable name="doctitle" --> <br /> <br /> <!-- InstanceEndEditable --> <br /> <br /> <!--[if IE]><br />    <style type="text/css"> <br />    /* Fügen Sie CSS-Korrekturen für alle IE-Versionen in diesen bedingten Kommentar ein. */<br />    .thrColLiqHdr #sidebar2, .thrColLiqHdr #sidebar1 { padding-top: 30px; }<br />    .thrColLiqHdr #mainContent { zoom: 1; padding-top: 15px; }<br />    /* Mit der obigen proprietären Zoom-Eigenschaft wird IE die Eigenschaft hasLayout zugewiesen, die zur Verhinderung verschiedener Fehler erforderlich ist. */<br />    </style><br />    <![endif]--> <br /> <!-- InstanceBeginEditable name="head" --> <br /> <!-- InstanceEditableHeadTag --> <br /> <br /> <script src="../includes/common/js/base.js" type="text/javascript"></script> <br /> <script src="../includes/common/js/utility.js" type="text/javascript"></script> <br /> <script src="../includes/skins/style.js" type="text/javascript"></script> <br /> <!-- InstanceEndEditable --> <br /> <script type="text/javascript"></script> <!--<br />function MM_swapImgRestore() { //v3.0<br />  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;<br />}<br />function MM_preloadImages() { //v3.0<br />  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();<br />    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)<br />    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}<br />}<br /><br />function MM_findObj(n, d) { //v4.01<br />  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {<br />    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}<br />  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];<br />  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);<br />  if(!x && d.getElementById) x=d.getElementById(n); return x;<br />}<br /><br />function MM_swapImage() { //v3.0<br />  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)<br />   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}<br />}<br />//--> <br /> <br /> <br /> <br /> <br /> <br /> <div id="container"> <br /> <div id="header"> <br /> <h1>Kohlhauer</h1> <br /> <!-- end #header --> </div> <br /> <div id="sidebar1"> <br /> <p> <a href="../index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Home','','../pic/home_rollover.png',1)"> <img src="../pic/home.png" alt="Home" width="170" height="32" border="0" id="Home" /> </a> </p> <br /> <p> <a href="../hugenotten/index.htm" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Hugenotten','','../pic/hug_rollover.png',1)"> <img src="../pic/hug.png" alt="Hugenotten" width="170" height="32" border="0" id="Hugenotten" /> </a> </p> <br /> <p>&#160;</p> <br /> <!-- end #sidebar1 --> </div> <br /> <div id="sidebar2"> <br /> <p> <a href="login.php">Login</a> <br /> <!-- end #sidebar2 --> <br /></p> <br /> <p> <a href="register.php" target="_self">Registrierung</a> </p> <br /></div> <br /> <!-- InstanceBeginEditable name="Content" --> <?php echo $tNGs->displayValidationRules();?> <br /> <div id="mainContent"> <br /> <h1>Login</h1> <br /> <p>&#160; <br /> <?php<br /> echo $tNGs->getLoginMsg();<br />?> <br /> <?php<br /> echo $tNGs->getErrorMsg();<br />?> <br /></p> <form method="post" id="form1" class="KT_tngformerror" action="%3C?php%20echo%20KT_escapeAttribute(KT_getFullUri());%20?%3E"> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br /> <table cellpadding="2" cellspacing="0" class="KT_tngtable"> <tr> <td class="KT_th"> <label for="kt_login_user">Username:</label> </td> <td> <input type="text" name="kt_login_user" id="kt_login_user" value="<?php echo KT_escapeAttribute($row_rscustom['kt_login_user']); ?>" size="32" /> <br /> <?php echo $tNGs->displayFieldHint("kt_login_user");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_user"); ?></td> </tr> <tr> <td class="KT_th"> <label for="kt_login_password">Password:</label> </td> <td> <input type="password" name="kt_login_password" id="kt_login_password" value="" size="32" /> <br /> <?php echo $tNGs->displayFieldHint("kt_login_password");?> <?php echo $tNGs->displayFieldError("custom", "kt_login_password"); ?></td> </tr> <tr> <td class="KT_th"> <label for="kt_login_rememberme">Remember me:</label> </td> <td> <input <?php if (!(strcmp(KT_escapeAttribute($row_rscustom['kt_login_rememberme']),"1"))) {echo "checked";} ?> type="checkbox" name="kt_login_rememberme" id="kt_login_rememberme" value="1" /> <br /> <?php echo $tNGs->displayFieldError("custom", "kt_login_rememberme"); ?></td> </tr> <tr class="KT_buttons"> <td colspan="2"> <input type="submit" name="kt_login1" id="kt_login1" value="Login" /> <br /></td> </tr> </table> <br /> <a href="forgot_password.php">Forgot your password?</a> <br /></form> <br /> <p>&#160;</p> <br /> <br /> <br /> <br /> <p>&#160;</p> <br /> <!-- end #mainContent --> <br /></div> <br /> <!-- Dieses clear-Element sollte direkt auf das #mainContent-div folgen, um das #container-div anzuweisen, alle untergeordneten Floats aufzunehmen. --> <br /> <!-- InstanceEndEditable --> <br class="clearfloat" /> <br /> <div id="footer"> <br /> <p>Fußzeile</p> <br /> <!-- end #footer --> </div> <br /> <!-- end #container --> </div> <br /> <br /> <!-- InstanceEnd-->
            • 3. Re: Cannot modify header information ...
              RichMariner Level 1
              If I had a nickle for every minute I wasted on this issue when I started using PHP. LOL