File includes in my script from other server...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
astp
Forum Newbie
Posts: 1
Joined: Sun Jan 12, 2003 4:34 am
Location: Latvia, Riga

File includes in my script from other server...

Post by astp »

subj. :oops:

I tried many things, but ... :?: :?: :?:

I tried this :

Code: Select all

<?

$a = readfile("http://localhost/~mafia/server_file.php");

?>
and it works...even U work width database :)

sorry about trouble :(
Last edited by astp on Sun Jan 12, 2003 5:17 am, edited 2 times in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

<?php echo date("m.d.y"); ?>
consider what the php-processor receives. If it reads from your local filesystem via include('dir/file.php'); it's most likely that it will see the script-code. But if you include something like include('http://oter.site/file.php'); the script might have been already parsed by the php-processor of the other server and only 12.01.2003 is read - not the script itself. There is no way to avoid this behaviour if you do not have access to the unparsed script-source.
Post Reply