Ok, so i think im getting closer to finding the issue.
I placed this code at the top of the page, to output errors:
error_reporting(E_ALL);
ini_set('display_errors', true);
And this error showed:
Warning: Cannot modify header information - headers already sent by (output started at /listing.php:7) in /includes/common/KT_functions.inc.php on line 426
Lines 7-15 of listings.php is:
// Load the common classes
require_once('../includes/common/KT_common.php');
// Require the MXI classes
require_once ('../includes/mxi/MXI.php');
// Load the tNG classes
require_once('../includes/tng/tNG.inc.php');
and the code starting from line 426 is:
function KT_redir($url) {
$protocol = "http://";
$server_name = $_SERVER["HTTP_HOST"];
if ($server_name != '') {
$protocol = "http://";
if (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == "on")) {
$protocol = "https://";
}
if (preg_match("#^/#", $url)) {
$url = $protocol.$server_name.$url;
} else if (!preg_match("#^[a-z]+://#", $url)) {
$script = KT_getPHP_SELF();
if (isset($_SERVER['PATH_INFO']) && $_SERVER['PATH_INFO'] != '' && $_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) {
$script = substr($script, 0, strlen($script) - strlen($_SERVER['PATH_INFO']));
}
$url = $protocol.$server_name.(preg_replace("#/[^/]*$#", "/", $script)).$url;
}
$url = str_replace(" ","%20",$url);
if (KT_is_ajax_request()) {
header("Kt_location: ".$url);
echo "Redirecting to: " . $url;
} else {
header("Location: ".$url);
}
}
exit;
}
So somehow im guessing that code is being called twice causing header issues. KT_functions.inc.php is referenced within KT_common.php.
This is the redirect class i found also:
class tNG_Redirect {
/**
* transaction object
* @var object tNG
* @access public
*/
var $tNG;
/**
* url to use for redirect
* @var string
* @access public
*/
var $URL;
/**
* if the GET params to be kept or not
* @var boolean
* @access public
*/
var $keepUrlParams;
/**
* Constructor. set the transaction
* @param object tNG transaction
* @access public
*/
function tNG_Redirect($tNG = null) {
$this->tNG = $tNG;
}
/**
* setter. set the URL to be used for redirect
* @param string
* @access public
*/
function setURL($URL) {
$this->URL = $URL;
if (strpos($URL,"includes/nxt/back.php") !== false) {
$this->URL = KT_makeIncludedURL($this->URL);
}
}
/**
* setter. if the GET params to be kept or not
* @param boolean
* @access public
*/
function setKeepURLParams($keepUrlParams) {
$this->keepUrlParams = $keepUrlParams;
}
/**
* Main method of the class. make the redirect
* @return nothing
* @access public
*/
function Execute() {
if (!isset($this->tNG)) {
$page = KT_DynamicData($this->URL,null,'rawurlencode');
} else {
$useSavedData = false;
if ($this->tNG->getTransactionType()=='_delete' || $this->tNG->getTransactionType()=='_multipleDelete') {
$useSavedData = true;
}
$page = KT_DynamicData($this->URL,$this->tNG,'rawurlencode',$useSavedData);
}
if ($this->keepUrlParams) {
foreach($_GET as $param => $value) {
$page = KT_addReplaceParam($page, $param, $value);
}
}
KT_redir($page);
}
}
Thanks for any help!!
Danny