php and xmlhttprequests

jurgen1604's Avatar
Newbie Member
Hi,

I'm working on a web application and for the first time I'm using Ajax. The problem I encouter is that when requesting a php file I get a fatal error because all the includes that I have done in my index.php file are not longer known in my requested file.

like this:
my index.php
include("cMyClass.php");

my form.php => form.js
req.open(POST,actionhandle.php,true);
req.send("name=myname");

my actionhandle.php
$myClass = new cMyClass();

When calling the actionhandle through my index file then cMyClass is known, but calling the actionhandle file directly with ajax then the class is not known.

Is there a solution for this problem?
I already tried calling the index file from ajax but then my requestText is not what I want. I get my complete DOM structure as requestText.

Thank you in advance.
0
pradeep's Avatar, Join Date: Apr 2005
Team Leader
You have not included "cMyClass.php" in actionhandle.php, I guess!