Topic: Output has already been sent to the browser at /home/index.php:1.

I have tried everything - hope someone has the answer. No spaces found and I removed and replaced every function. Into this for about 5 hours. I have included the header of the index.php and the source.php. Everything works great in WAMP. I tried ob_start in the source.php

Thanks.

Index.php
<?php require_once("source.php"); ?>

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>Create ur calendar ur way</title>
<link REL="SHORTCUT ICON" HREF="images/site.ico">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="css/hover.css" rel="stylesheet" type="text/css">
<link href="css/button.css" rel="stylesheet" type="text/css">
<link href="css/form.css" rel="stylesheet" type="text/css">
<link href="css/colorpicker.css" rel="stylesheet" type="text/css">
<link href="css/responsive.css" rel="stylesheet" type="text/css">
<link href="layerslider/css/layerslider.css" rel="stylesheet" type="text/css">

<?php $xajax->printJavascript(); ?>
</head>
<body>

source.php
<?php
session_start();
require_once("xajax_core/xajax.inc.php");
require_once("config.php");

if (isset($_GET['action'])) $action = $_GET['action']; else $action = 0;
.
.
.
$xajax = new xajax();
//$xajax->setFlag("debug", true);
$xajax->registerFunction("initial");
$xajax->registerFunction("forgot");
$xajax->registerFunction("emailUs");
$xajax->registerFunction("paypalForm");
$xajax->registerFunction("paypalCancel");
$xajax->registerFunction("login");
$xajax->registerFunction("editEvent");
$xajax->registerFunction("saveEvent");
$xajax->registerFunction("getMonth");
$xajax->registerFunction("saveGeneral");
$xajax->registerFunction("eventRecord");
$xajax->registerFunction("showCalendar");
$xajax->processRequest();
?>

Re: Output has already been sent to the browser at /home/index.php:1.

Hi,

Not sure but try removing the blank line between <?php require_once("source.php"); ?> and <!DOCTYPE HTML>

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: Output has already been sent to the browser at /home/index.php:1.

I have shortened the source to one function for testing:

<?php
session_start();
require_once("xajax_core/xajax.inc.php");
if($_SERVER['HTTPS'] != 'on') header('Location: https://www.urcalendars.com/index.php');
function currentMonth($formData)
{
   $objResponse = new xajaxResponse();
   $_SESSION['month'] = $formData['cmonth'];
   $objResponse->Script('xajax_getMonth()');
   return $objResponse;   
}
$xajax = new xajax();
$xajax->setFlag("debug", true);
$xajax->registerFunction("currentMonth");
$xajax->processRequest();
?>

I have the debug turned on and no spaces in the index.php - still the same error on the godaddy server - is there a setting on the server
that could cause this error? The index.php does not make any xajax calls.

Thanks.

Re: Output has already been sent to the browser at /home/index.php:1.

I know of no setting on the server that would cause this.

This is not a server setting. It means that something was sent from the server and xajax cannot send anything when that has happened.

If you would like you can email me the files and I'll take a look at them.

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

5 (edited by flemingfactor 2014-03-18 6:26:18 PM)

Re: Output has already been sent to the browser at /home/index.php:1.

Take out the closing PHP tag (?>)  any space after it or a blank line will case this.  We have stopped using the closing PHP tag completely because of this, and because it is unnecessary.