Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1518 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Cross-Site Includes?

Thread title: Cross-Site Includes?
Closed Thread    
    Thread tools Search this thread Display Modes  
12-04-2007, 08:23 PM
#1
Seb is offline Seb
Seb's Avatar
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
 
Posts: 3,312
iTrader: 36 / 100%
 

Seb is on a distinguished road

  Old  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
CreativeLogic is offline CreativeLogic
CreativeLogic's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 1,078
iTrader: 6 / 100%
 

CreativeLogic is on a distinguished road

Send a message via MSN to CreativeLogic

  Old

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
Wildhoney is offline Wildhoney
Wildhoney's Avatar
Status: Request a custom title
Join date: Feb 2006
Location: Nottingham
Expertise:
Software:
 
Posts: 1,648
iTrader: 18 / 95%
 

Wildhoney is on a distinguished road

Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney

  Old

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
Seb is offline Seb
Seb's Avatar
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
 
Posts: 3,312
iTrader: 36 / 100%
 

Seb is on a distinguished road

  Old

Originally Posted by Wildhoney View Post
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
mjanczyk is offline mjanczyk
Status: I'm new around here
Join date: Oct 2007
Location: Poland/UK
Expertise:
Software:
 
Posts: 16
iTrader: 0 / 0%
 

mjanczyk is on a distinguished road

  Old

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
Village Genius is offline Village Genius
Village Genius's Avatar
Status: Geek
Join date: Apr 2006
Location: Denver, CO
Expertise: Software
Software: Chrome, Notepad++
 
Posts: 6,894
iTrader: 18 / 100%
 

Village Genius will become famous soon enough

  Old

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
Tech07 is offline Tech07
Status: I'm new around here
Join date: Jun 2007
Location: Canada
Expertise:
Software:
 
Posts: 17
iTrader: 0 / 0%
 

Tech07 is on a distinguished road

  Old

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
Seb is offline Seb
Seb's Avatar
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
 
Posts: 3,312
iTrader: 36 / 100%
 

Seb is on a distinguished road

  Old

Originally Posted by Tech07 View Post
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
mjanczyk is offline mjanczyk
Status: I'm new around here
Join date: Oct 2007
Location: Poland/UK
Expertise:
Software:
 
Posts: 16
iTrader: 0 / 0%
 

mjanczyk is on a distinguished road

  Old

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
Seb is offline Seb
Seb's Avatar
Status: Watermelon Man
Join date: Nov 2006
Location: London
Expertise:
Software:
 
Posts: 3,312
iTrader: 36 / 100%
 

Seb is on a distinguished road

  Old

Originally Posted by mjanczyk View Post
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*

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed