Ajay_kumar
Ajay_kumar

Reputation: 57

problem creating with object in php

I need some technical help.I have a program which is only class file and this file situated at my www.classexample.com server and my file name is myfirstclass.php. I making my other php file which will use create an object of this class file and its file name is mysecondtest.php but this file is on my other server www.objecttest.com.

How will i create and object of same class ? When i am including file like include 'http://www.classexample.com/myfirstclass.php'

and creating a object i am getting an error (class is not defined). How will i able to make an object which are situated on other server.

Any idea will be appreciate you. Thank you.

Upvotes: 0

Views: 87

Answers (1)

Your Common Sense
Your Common Sense

Reputation: 158004

When you including like include 'http://www.classexample.com/myfirstclass.php', you do not include any files.
If you really want to use a PHP code from other domain, rename your class definition file to myfirstclass.txt
But the whole idea of cross-domain class definition seems very unusual, not to say more.
If both sites share the same server, do include files, not URLs

Upvotes: 2

Related Questions