I have a problem with my include statements. I have several php files that are loaded when the page is initially loaded and then called again by jQuery ajax calls. Because of the ajax calls I don't have the php script in a function and but I am getting an error with my includes statement when I call them from a different location (the ajax call). For example my main page includes this php script:
<div id="controlPanelForm">
<?php include "lib/getControlPanel.php"; ?>
</div>
Here is the first few lines of the getControlPanel.php file:
<?php
include_once("../etc/includes.php");
...do something...
Here is the ajax call:
function getControl(teamID)
{ $.ajax({
type: "GET",
data: {teamID: teamID},
url: "./lib/getControlPanel.php",
dataType: "html",
async: true,
success: function(response)
{
$('#controlPanelForm').html(response);
}
});
}
So the problem is when I call the php script from the ajax call I get this error:
include_once(../etc/includes.php): failed to open stream: No such file or directory in
If I change the relative path, the original include from the main page doesn't work...
How can I fix this issue?
Thanks in advance!
include_oncethe next time it is called from the ajax call it does not load. If I just doincludeI get this error on the initial include from the main page:CONSTANT HOST ALREADY DEFINED...