problem in object creation with remote access class file

Discussion in 'PHP' started by tech_tycoon, Sep 5, 2010.

  1. #1
    Hi,
    I am making an api this api has on class , member function of this class check the result of each object.I am giving a small php code for this integration of api to all my client.In this code an object will be created with the api class.But the class file is on my server and each client objects will access this api class.
    But when i am including class file path by
    include 'http://www.myserver.com/class.php'
    and creating object to client api code
    i am getting an error that class is not defined.i am guessing we can't access class file remotely tha's why error is coming.
    What i should to do to access this class file remotely ?
    a brief more info will be appreciate
    thanks all.
     
    tech_tycoon, Sep 5, 2010 IP
  2. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #2
    Try to include it by relative path, not by absolute path.

    eg.
    
    include 'class.php';
    
    PHP:
    One thing you should keep in mind that you cannot include an external php file, you can only include whatever it can access in the server.
     
    Rainulf, Sep 5, 2010 IP