classes from different server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
silent
Forum Newbie
Posts: 1
Joined: Sun Mar 26, 2006 1:01 am

classes from different server

Post by silent »

okay,

say i got 2 servers.

server 1: http://server1.com
server 2: http://server2.com

and i have a collection of my classes say class1.php, class2.php all stored in http://server2.com/class/

and i want to use the class1php and class2.php for http://server1.com without saving the file onto that server1 too. can i do it so that i can just access the files on the server2.com?

i've tried include('http://server2.com') and did a few error checks like:

echo 'testing' and if statements all the error checks work but when i try to create the object it say class not found. can someone help me with this please?

regards
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you'll have to rig the request to return the source code to server2, this is a security hole. Not only that, but it will cause server2's pages to run much slower than having the files on the server.
Post Reply