Whats the right way of giving $_SERVER['DOCUMENT_ROOT'] path.
UPDATED:
Ie) In my app\design\frontend\base\default\template\folder\index.php i need to call other config files which is in document root of magento.
<?php
// Show only compile error
error_reporting(E_COMPILE_ERROR );
// check if pdo library enabled ?
require_once($_SERVER['DOCUMENT_ROOT'] . '/magento/test/ajax_table.class.php');
$obj = new ajax_table();
$records = $obj->getRecords();
?>
<!DOCTYPE html>
<html>
<head>
<script>
...
</script>
</head>
</html>
var\www\html\magento\test\ajax_table.class.php
require_once($_SERVER['DOCUMENT_ROOT'] . '/magento/test/config.php');
class ajax_table {
..
}
If i include the above:
<?php
// Show only compile error
error_reporting(E_COMPILE_ERROR );
// check if pdo library enabled ?
require_once('/test/ajax_table.class.php');
$obj = new ajax_table();
$records = $obj->getRecords();
?>
UPDATED:
Also path mismatch here:
\magento\skin\frontend\rwd\default\js\test\script.js
ajax = function (params,action){
$.ajax({
type: "POST",
url: "ajax.php", //ajax.php is in var\www\html\magento\test\ajax.php
data : params+"&action="+action,
dataType: "json",
success: function(response){
...}
I get blank screen with controller error...
Table insertion/ other operation is happening if i keep my index.php in same var\www\html\magento\test folder.
Its path issue.
The file seems to get called when i echo inside it, but functionality is not as expected, which works if i keep index.php too in the root folder, but i want it in design folder