close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cannot modify header information

Thread began 12/19/2016 5:28 am by robert254422 | Last modified 12/21/2016 6:55 pm by Ray Borduin | 444 views | 5 replies |

robert254422

Cannot modify header information

Hello,

When using mysqli authentication on a webpage I get the following message:

Warning: Cannot modify header information - headers already sent by (output started at /home/folder/domains/domain.nl/public_html/cms60/start.php:1) in /home/folder/domains/domain.nl/public_html/cms60/webassist/mysqli/authentication.php on line 206

I have checked the start.php file a couple of times now for blank lines of code specifically on line 1 but found none...
On the very first line of start.php it calls in the mysqli connections include -> No blank lines there
On the second line it includes the authentication.php file -> No blank lines there
On the third line the authentication starts...

///

First 21 lines of start.php
<?php require_once('Connections/cms_i.php'); ?>
<?php require_once('webassist/mysqli/authentication.php'); ?>
<?php
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$Authenticate = new WA_MySQLi_Auth($verbind_i);
$Authenticate->Action = "authenticate";
$Authenticate->Name = "loginCMS60";
$Authenticate->Table = "login";
$Authenticate->addFilter("Log_User", "=", "s", "".((isset($_POST["un"]))?$_POST["un"]:"") ."");
$Authenticate->addFilter("Log_Password", "=", "s", "".((isset($_POST["ww"]))?$_POST["www"]:"") ."");
$Authenticate->storeResult("Log_Id", "sessionId");
$Authenticate->storeResult("Log_User", "sessionUser");
$Authenticate->storeResult("Log_Password", "sessionPassword");
$Authenticate->AutoReturn = true;
$SuccessRedirect = "inside.php";
$FailedRedirect = "start.php?acces=no";
if (function_exists("rel2abs")) $SuccessRedirect = $SuccessRedirect?rel2abs($SuccessRedirect,dirname(__FILE__)):"";
if (function_exists("rel2abs")) $FailedRedirect = $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
$Authenticate->SuccessRedirect = $SuccessRedirect;
$Authenticate->FailRedirect = $FailedRedirect;
$Authenticate->execute();
}?>

I have also tried to change the order of the first three occurances on the page

Any suggestions on where els to look for the problem?

With Kind regards RV.

Sign in to reply to this post

robert254422

No response

Originally Said By: robert254422
  Hello,

When using mysqli authentication on a webpage I get the following message:

Warning: Cannot modify header information - headers already sent by (output started at /home/folder/domains/domain.nl/public_html/cms60/start.php:1) in /home/folder/domains/domain.nl/public_html/cms60/webassist/mysqli/authentication.php on line 206

I have checked the start.php file a couple of times now for blank lines of code specifically on line 1 but found none...
On the very first line of start.php it calls in the mysqli connections include -> No blank lines there
On the second line it includes the authentication.php file -> No blank lines there
On the third line the authentication starts...

///

First 21 lines of start.php
<?php require_once('Connections/cms_i.php'); ?>
<?php require_once('webassist/mysqli/authentication.php'); ?>
<?php
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$Authenticate = new WA_MySQLi_Auth($verbind_i);
$Authenticate->Action = "authenticate";
$Authenticate->Name = "loginCMS60";
$Authenticate->Table = "login";
$Authenticate->addFilter("Log_User", "=", "s", "".((isset($_POST["un"]))?$_POST["un"]:"") ."");
$Authenticate->addFilter("Log_Password", "=", "s", "".((isset($_POST["ww"]))?$_POST["www"]:"") ."");
$Authenticate->storeResult("Log_Id", "sessionId");
$Authenticate->storeResult("Log_User", "sessionUser");
$Authenticate->storeResult("Log_Password", "sessionPassword");
$Authenticate->AutoReturn = true;
$SuccessRedirect = "inside.php";
$FailedRedirect = "start.php?acces=no";
if (function_exists("rel2abs")) $SuccessRedirect = $SuccessRedirect?rel2abs($SuccessRedirect,dirname(__FILE__)):"";
if (function_exists("rel2abs")) $FailedRedirect = $FailedRedirect?rel2abs($FailedRedirect,dirname(__FILE__)):"";
$Authenticate->SuccessRedirect = $SuccessRedirect;
$Authenticate->FailRedirect = $FailedRedirect;
$Authenticate->execute();
}?>

I have also tried to change the order of the first three occurances on the page

Any suggestions on where els to look for the problem?

With Kind regards RV.  
Sign in to reply to this post

Ray BorduinWebAssist

Sorry for the delay. The error implies that the connection is throwing an error or has a space in the code.

The error states: "output started at /home/folder/domains/domain.nl/public_html/cms60/start.php:1"

That means that the first line is outputting code to the page and a connection shouldn't be outputting code. Are there any blank lines, spaces, or other code on that line or in the referenced include file from that line? Is the connection information correct and not throwing an error? That is what would be causing this error.

If you give me FTP access I could debug and tell you precisely what the problem is.

Sign in to reply to this post

robert254422

Access

Hello Ray,

Thank you very much for your reply... Access details are provided in private message.

Regarding your questions...
I see no white lines or extra spaces and basically the include file is the connections file generated by the mysqli extension...
I have changed the order of includes in a couple of ways... Where it did not throw errors doing this it kept referring to line 1 regardless

Connection information is correct and as soon as I remove everything related to the authentication from the pages behind this one there are no more issues with header already send... Also good to know is that this same cms works just fine on another live server

I hope you can find the cause... Almost hoping it is not just a white space in the wrong place cause then I'll just feel silly

Thank you very much in advance....

WKR

RV

Sign in to reply to this post

Ray BorduinWebAssist

The file itself was corrupted somehow. I've seen this once or twice before.

All I did to fix it was:
1) create a new blank file
2) copy and paste the entire page from the broken page
3) delete the broken page
4) rename the file to the old page name

Technically those steps should result in the exact same file being created, but for some reason it fixes it.

Sign in to reply to this post

robert254422

Thank you very much Ray.... Don't think that woud have entered my mind as option to try...
Very glad it wasn't a white space or line though... Again Thank you very much for the support ... wkr rv

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...