Re: Protecting Include remote files
| From: | Radek Vybiral | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: Protecting Include remote files | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-3790@lists.php.net to get a copy of this message | ||
On Wed, 28 Jun 2000, Reuben D Budiardja wrote:
>
> Hi,
>
> I have two server running php. One of them connect with Oracle, and
> have been used for Php application for administration in my institution,
> and only a certain user can use it (let's call it server1). The second
> server is only a web server (server2).
>
> Now, I am creating an application in server1 (using database and stuff). I
> want to displayed to public, thus I include the application page in
> server2. So, in server2, I would have something like
> include ('http://server1.domain.com/blah.php3'); .
>
> My question is, can I protect that application in server1 (blah.php3) so
> that it cannot be included by anyone except by server2 ? I mean, if I know
> the URL address for the application in server1, I can use any server,
> serverX, to include that application in my page right? Is there anyway to
> avoid this?
Include in your bla.php3:
if $HTTP_REFERER <> server1
echo "Go away!"
R.V.
+-------------------------------------------------------------------------+
| Radek Vybiral Radek.Vybiral @ vsb.cz |
| Technical University of Ostrava http://www.vsb.cz/~l92494 |
| Czech Republic GSM: +420 602 473 670 |
| Projects: Admin on darksys.vsb.cz http://darksys.vsb.cz |
| NEW! Czech: Sluzby automobilistum http://www.automobil.cz |
| |
| J.W Goethe: "Prestoze svet stale pokracuje, mladi lide musi |
| vzdy zacinat od zacatku." |
+-------------------------------------------------------------------------+