|
|
|
|
Thread title: Cross-Site Includes? |
|
|
|
|
|
Thread tools
Search this thread
Display Modes
|
|
12-04-2007, 08:23 PM
|
#1
|
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
Posts: 3,312
|
Cross-Site Includes?
Is it possible to include files on different sites? So could I include a file from domain.com on domain2.com ? Is this possible? Can it be done in PHP?
Thanks,
Seb
|
|
12-04-2007, 08:31 PM
|
#2
|
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
Posts: 1,078
|
Depends on what exactly you're trying to accomplish. If you're trying to include only the outputted contents (html) then you could do that. If you're trying to include the php code it's not possible without going around the server but most likely different accounts will be 'jailed' and will not be able to include files in other folders.
|
|
12-04-2007, 09:25 PM
|
#3
|
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
Posts: 1,648
|
Just not possible unless you modify the extension of the PHP to say something like PHPS (PHP source, which is actually a valid extension), so the other server can download the content with the PHP code in it. You will then want to use the eval() construct to execute the PHP code. Be very careful you know what you're executing though.
|
|
12-04-2007, 10:08 PM
|
#4
|
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
Posts: 3,312
|
Originally Posted by Wildhoney
Just not possible unless you modify the extension of the PHP to say something like PHPS (PHP source, which is actually a valid extension), so the other server can download the content with the PHP code in it. You will then want to use the eval() construct to execute the PHP code. Be very careful you know what you're executing though.
|
Thanks Adam, will look into that. I would only be executing scripts used on my sites, not off third party.
|
|
12-05-2007, 05:26 PM
|
#5
|
Status: I'm new around here
Join date: Oct 2007
Location: Poland/UK
Expertise:
Software:
Posts: 16
|
Note it won't be ever safe. Always somebody in the righ place of the Net could modify what your script gets, if there is any machine between your servers.
|
|
12-05-2007, 07:17 PM
|
#6
|
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
Posts: 6,894
|
What wildhoney said will work, but its extremely insecure. However you should be able to set .htaccess to only allow your servers IP to access the folder the file is in.
|
|
12-06-2007, 01:11 AM
|
#7
|
Status: I'm new around here
Join date: Jun 2007
Location: Canada
Expertise:
Software:
Posts: 17
|
If you have your domains on the same host you could do it no problem, it would be super easy if you had cpanel and your other domain was a subdomain and just used a add on domain, if that makes any sense!
|
|
12-06-2007, 07:47 AM
|
#8
|
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
Posts: 3,312
|
Originally Posted by Tech07
If you have your domains on the same host you could do it no problem, it would be super easy if you had cpanel and your other domain was a subdomain and just used a add on domain, if that makes any sense!
|
At the moment, all my sites would be on the same server. I half understood what you said, any chance you could explain it a little better? Thanks.
|
|
12-06-2007, 09:23 AM
|
#9
|
Status: I'm new around here
Join date: Oct 2007
Location: Poland/UK
Expertise:
Software:
Posts: 16
|
If they are on the same server, why won't you just include as usually? Even with different accounts, you can ACL your way to the file and include().
|
|
12-06-2007, 04:44 PM
|
#10
|
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
Posts: 3,312
|
Originally Posted by mjanczyk
If they are on the same server, why won't you just include as usually? Even with different accounts, you can ACL your way to the file and include().
|
I didn't even think about that *laughs at self*
|
|
|
|
|
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|