RE: [PHP] possible to get a function from another domain

From: Date: Tue, 23 Aug 2005 20:11:58 +0000
Subject: RE: [PHP] possible to get a function from another domain
Groups: php.general 
Request: Send a blank email to php-general+get-221206@lists.php.net to get a copy of this message
> [snip] > Can I use require with http? > > My domain: www.varupiraten.se > > Other domain: www.webshop2.se > > Does this kind of code work? > > Code for my domain: > <?php > require(http://www.webshop2.se/externfunctions.php); > $x = getValueFromProduct('Inno AX5000'); //This function > retrieves price > > from webshop2.se > ? > [/snip] > > Have you tried it? > > Really, unless you own the the other domain and have a way to > access the > data, you really cannot do this without some sort of screen > scraping or > URL munging. Let us say that you know the product listing for > the other > domain is something like > > http://www.webshop2.com/productInfo.php?product=Inno_AX5000 > > You could retrieve that data and manipulate it. > But even if you did, you're giving the other guy the power to break your site. All he has to do is change the URL or the format of the page, and BOOM, your site croaks. So a relevant question is: "Do you have control of the other site, or at least the cooperation of the other site's owner?" JM

« previous php.general (#221206) next »