Hi,
I am just starting to play around with ajax and I have create a drag and drop table to alter the order of system.
I have the following code on the client side that loads my php file.
[CODE]
$(‘#admintable’).load(“/includes/ajax.php?type=gallery&action=order&var=” + $.tableDnD.serialize())
That appears to be working ok.
Anyway what the problem is, is with the backend.
This script below is a script that is obviously being called as if it is an external page (above). the problem is I want to use some class variables and definitions from my main script.
How do I do that.
[code=php]
// First just check it is being called from within the domain
if ($_SERVER[‘HTTP_HOST’]==ltrim(DOMAIN,”https://”)) {
// Get the variables
$type = $_GET[‘type’];
$action = $_GET[‘action’];
// now run the the types
switch ($type) {
case “gallery”:
// Now run through the actions
switch ($action) {
case “order”:
break;
}
break;
}
} else {
echo “SECURITY BREACH!”;
}
Obviously the definition DOMAIN is a definition defined in one of my include files but the problem is; So is all my msql functions and connection details and all sorts of other stuff.
What I want to know is:
Rather than me listing my include files within this script. Can it somehow use all the definitions and classes that have already been defined through the main webpage?
I hope this is clear, if not just let me know
Thanks
k0r54