Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

include another domain...

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

include another domain...

Postby Xerpher » Sat Sep 28, 2002 1:14 pm

can I include a php file from another site?
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby DoppyNL » Sat Sep 28, 2002 10:51 pm

yes:
Code: Select all
include('http://www.otherdomain.com/myphpfile.php');


It can take a little longer for that is processes because php has to get the file from the remote server.

Greetz Daan
DoppyNL
 

Postby Jay » Sun Sep 29, 2002 11:39 pm

It's worth bearing in mind that you'll only get the output, and not the PHP code itself using this method (as it's coming via HTTP).
Jay
 

Postby Xerpher » Mon Sep 30, 2002 7:34 am

Is there a way to get the code?
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby DoppyNL » Mon Sep 30, 2002 7:37 am

configure the remote server so it doesn't parse php-files or simply change the extention of the file.

You could also acces the file via ftp with a username or password, allthough this is much slower!

There is no way to get the code from a php file on a webserver wich parses php files.
I'm glad there isn't, otherwise everyone would be able to read my code, AND passwords in the file.

Greetz Daan
DoppyNL
 

Postby Jay » Mon Sep 30, 2002 10:57 am

Out of curiosity, why would you want to do this?
Jay
 

Postby Xerpher » Mon Sep 30, 2002 12:51 pm

I'm glad there isn't a way either. I wanted to know if it was possible to make sure my code would be safe, thats all :)
Xerpher
New php-forum User
New php-forum User
 
Posts: 164
Joined: Tue Aug 27, 2002 8:25 pm
Location: Ontario, Canada

Postby Jay » Mon Sep 30, 2002 1:12 pm

Well, it's safe unless someone hacks into your machine. PHP is only parsed when called through the HTTP server. Otherwise it's send as the normal file through FTP etc. Someone would have to hack into your machine to get it.
Jay
 


Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.