1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php and xmlhttprequests

Discussion in 'PHP' started by jurgen1604, Feb 15, 2007.

  1. jurgen1604

    jurgen1604 New Member

    Joined:
    Feb 15, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    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.
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    You have not included "cMyClass.php" in actionhandle.php, I guess!
     

Share This Page