473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Cross domain include()?

Hi,
Can someone please outline the safest and easiest way to import some
code from another domain and run it?
Thanks,
Ciaran
Jul 14 '08 #1
8 5943
..oO(Ciaran)
>Can someone please outline the safest and easiest way to import some
code from another domain and run it?
What's the reason for this? It will be insecure and slow.

Just make sure that the remote server doesn't parse the PHP code, but
delivers the code as-is.

Micha
Jul 14 '08 #2
On Jul 14, 10:34 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Ciaran)
Can someone please outline the safest and easiest way to import some
code from another domain and run it?

What's the reason for this? It will be insecure and slow.

Just make sure that the remote server doesn't parse the PHP code, but
delivers the code as-is.

Micha
Just thought it might be a good way to run a CMS system for my
customers from a central source on my own website that is easily
updatable, etc.
Jul 14 '08 #3
..oO(Ciaran)
>On Jul 14, 10:34 pm, Michael Fesser <neti...@gmx.dewrote:
>.oO(Ciaran)
>Can someone please outline the safest and easiest way to import some
code from another domain and run it?

What's the reason for this? It will be insecure and slow.

Just make sure that the remote server doesn't parse the PHP code, but
delivers the code as-is.

Micha

Just thought it might be a good way to run a CMS system for my
customers from a central source on my own website that is easily
updatable, etc.
Bad idea:

* For every single include file it requires an HTTP connection to the
remote server. Usually a CMS consists of dozens if not hundred includes.
This overhead will become measurable quite quickly. Even the include of
just a single file via HTTP will be much slower than direct disk access.

* All of your CMS source code would be readable to everyone who knows
the URLs unless you use SSL, which would make it even slower.

* Finally don't underestimate the caused network traffic on your own and
and the client servers. Especially on your side this may easily become
several hundred MB _per_day_ in the worst case.

The only sitation where this makes sense is if the various domains are
hosted on the same server under the same user account. Then of course
you can share a single CMS instance between the different sites.

Micha
Jul 14 '08 #4
On Jul 14, 5:20*pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Ciaran)
On Jul 14, 10:34 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Ciaran)
Can someone please outline the safest and easiest way to import some
code from another domain and run it?
What's the reason for this? It will be insecure and slow.
Just make sure that the remote server doesn't parse the PHP code, but
delivers the code as-is.
Micha
Just thought it might be a good way to run a CMS system for my
customers from a central source on my own website that is easily
updatable, etc.

Bad idea:

* For every single include file it requires an HTTP connection to the
remote server. Usually a CMS consists of dozens if not hundred includes.
This overhead will become measurable quite quickly. Even the include of
just a single file via HTTP will be much slower than direct disk access.

* All of your CMS source code would be readable to everyone who knows
the URLs unless you use SSL, which would make it even slower.

* Finally don't underestimate the caused network traffic on your own and
and the client servers. Especially on your side this may easily become
several hundred MB _per_day_ in the worst case.

The only sitation where this makes sense is if the various domains are
hosted on the same server under the same user account. Then of course
you can share a single CMS instance between the different sites.
I tend to agree with you, but there likely always are a few
exceptions. I have 2 domains, one with a subdomain, on the same
server, and sometimes share things without problems. This usually
involves only very large files, such as streaming video, that I do not
want to duplicate. Large data bases also come to mind. However there
is much to be said for putting everything needed for a page in the
same directory with it so you can nearly always use short relative
urls and do not have to worry that if you delete a file in some
directory it may have been needed by a file in some other directory.
This may mean duplication in various directories, but short of long
data and streaming video files etc, this is no problem for many these
days where you often have nearly unlimited disk storage provided. Disk
storage, in contrast to earlier days, is now nearly dirt cheap.

Jul 14 '08 #5
I wrote:
>The only sitation where this makes sense is if the various domains are
hosted on the same server under the same user account. Then of course
^^^^^^^^^^^^^^^^^^^^^^^^^
>you can share a single CMS instance between the different sites.
You wrote:
>I tend to agree with you, but there likely always are a few
exceptions. I have 2 domains, one with a subdomain, on the same
^^^^^^^^^^^
>server, and sometimes share things without problems. This usually
^^^^^^

Micha
Jul 15 '08 #6
On Jul 14, 11:20 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Ciaran)
On Jul 14, 10:34 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Ciaran)
Can someone please outline the safest and easiest way to import some
code from another domain and run it?
What's the reason for this? It will be insecure and slow.
Just make sure that the remote server doesn't parse the PHP code, but
delivers the code as-is.
Micha
Just thought it might be a good way to run a CMS system for my
customers from a central source on my own website that is easily
updatable, etc.

Bad idea:

* For every single include file it requires an HTTP connection to the
remote server. Usually a CMS consists of dozens if not hundred includes.
This overhead will become measurable quite quickly. Even the include of
just a single file via HTTP will be much slower than direct disk access.

* All of your CMS source code would be readable to everyone who knows
the URLs unless you use SSL, which would make it even slower.

* Finally don't underestimate the caused network traffic on your own and
and the client servers. Especially on your side this may easily become
several hundred MB _per_day_ in the worst case.

The only sitation where this makes sense is if the various domains are
hosted on the same server under the same user account. Then of course
you can share a single CMS instance between the different sites.

Micha
Hmm OK thanks for the input. It was just an idea anyways. it's a pity
it's not more feasible - it would be very handy if it was fast and
secure!
Cheers,
Ciarán
Jul 15 '08 #7
On Jul 14, 10:34 pm, Michael Fesser <neti...@gmx.dewrote:
.oO(Ciaran)
Can someone please outline the safest and easiest way to import some
code from another domain and run it?

What's the reason for this? It will be insecure and slow.
Insecure?

No, but it does potentially open a new vector for attacks.

Slow?

Yes, but it might still be faster than an alternative approach.

For preference I would advise using rsync (preferably over ssh) to
replicate the code, but there are scenarios where this is a valid
approach (but if you understand the context where this is appropriate
then I'd expect that you wouldn't need to ask the original question).

In case the context is appropriate for the solution, it would probably
be more appropriate to use a caching copier to replicate the file
locally and include it from there.

C.
Jul 15 '08 #8
On Jul 14, 4:19*pm, Ciaran <cronok...@hotmail.comwrote:
Hi,
Can someone please outline the safest and easiest way to import some
code from another domain and run it?
Thanks,
Ciaran
I'm not sure if I'm thinking about this on the same level as you, but
here is a thought:
If these PHP scripts you want to share among sites are all on the same
server, why not just change the include path in the php.ini file to
and upper-level directory that contains the common script files or
codebase? Check this out to get an idea of what I'm talking about (of
course this page speaks to an actualy PHP command, whereas I'm talking
about actually editing your config file in a permanant kind of way;
it's the same basic premise though):
http://us3.php.net/manual/en/functio...clude-path.php
Jul 15 '08 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Angus SC2 | last post by:
Hi I am trying to set up cross domain cookies on a server I have running that currently has 2 domains running on it (on different IPs). Basically I have a forums site (using UBB threads) and I...
6
by: Charles Crume | last post by:
Hello; My index.htm page (www.charlescrumesoftware.com for those interested in looking) contains 3 frames (left = content, top right = logo, bottom right = navigation). This domain name is...
4
by: Adrian | last post by:
can someone explain the cross domain security re AJAX in IE? I have a page that calls a web service (WS) from another domain (the target browser is only IE6) and displays it's results! all works...
3
by: aspmonger | last post by:
Hello, I really believe that IE 6 has a new (intentional?) bug that severely limits the capability of dhtml and cross domain scripting. Yesterday, I read an interesting article about the subject and...
6
by: Simon | last post by:
Hi All, An experiment i'm doing requires requires a synchronous cross-domain request, without using a proxy. I wondered if anyone had any ideas to help me achieve this. Below is what I have...
5
by: Spam Catcher | last post by:
Hello Everyone, I need to implement single sign on across serveral applications. Some applications are under my control while others are under the control of 3rd parties. Can anyone suggest a...
0
by: mrvnchoudhary | last post by:
Hi All, I am working on some website tracking project. In which I have to keep some plugins on a server and we include that plugins in our diffrent web sites page(all pages). That plugins use some...
6
by: Bart Van der Donck | last post by:
Hello, I'm presenting my new library 'AJAX Cross Domain' - a javascript extension that allows to perform cross-domain AJAX requests. http://www.ajax-cross-domain.com/ Any comments or...
6
by: ampo | last post by:
Hello. Can anyone help with cross-domain problem? I have HTML page from server1 that send xmlHTTPRequest to server2. How can I do it? Thanks.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.