[eluser]Unknown[/eluser]
hi
im trying to use the projax and tinyAjax library , i also configured them as the are asked in CI wiki but in both case im gating the following warning ( i know why its happened usually "register_globals" , i have tried to fix it by making it off/on but its not working.)
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at D:\wamp\www\PD\system\application\controllers\ajax.php:40)
Filename: errors/error_404.php
Line Number: 1
my controller and view file are as bellow:
Controller:
Code:
<?php
class Ajax extends Controller {
function Ajax()
{
parent::Controller();
$this->load->library('tinyajax');
}
function multiply()
{
$this->tinyajax->showLoading();
$this->tinyajax->exportFunction("ajax_multiply", array("first_id", "second_id"), "#third_id", $this);
$this->tinyajax->process();
$this->load->view('ajax_multiply');
function ajax_multiplyb($x, $y)
{
$res = $x * $y;
$res_text = "Multiplying $x and $y results in $res";
$tab = new TinyAjaxBehavior();
$tab->add(TabSetValue::getBehavior("third_id", $res));
$tab->add(TabInnerHtml::getBehavior("result_div", $res_text));
return $tab->getString();
}
function multiplyb()
{
$this->tinyajax->showLoading();
$this->tinyajax->exportFunction("ajax_multiplyb", array("first_id", "second_id"), null, $this);
$this->tinyajax->process();
$this->load->view('ajax_multiplyb');
}
}
}
?>
View:
Code:
<html>
<head>
<? $this->tinyajax->drawJavaScript(false,true); ?>
</head>
<body>
Multiply:<br>
<input type="text" id="first_id" value="2"> *
<input type="text" id="second_id" value="3"> =
<input type="text" id="third_id" value="">
<input type="button" value=" * " onclick="ajax_multiplyb()">
<br/>
<div id="result_div"> </div>
</body>
</html>
i think both of the library is not working for one reason.
will anyone tell me how to fix it ?