RE: Include Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Boyd, Todd M. [mailto:tmboyd1@xxxxxxxx]
> Sent: Tuesday, June 24, 2008 1:48 PM
> To: Wei, Alice J.
> Cc: php-general@xxxxxxxxxxxxx
> Subject: RE:  Include Problem
> 
> > -----Original Message-----
> > From: Wei, Alice J. [mailto:ajwei@xxxxxxxxxxx]
> > Sent: Tuesday, June 24, 2008 1:39 PM
> > To: Boyd, Todd M.
> > Cc: php-general@xxxxxxxxxxxxx
> > Subject: RE:  Include Problem
> >
> > Hi,
> >
> >   Thanks for the clarifcations.
> >   I have two more questions regarding this issue:
> >
> >    1. If I try to do this from Windows platform to another Window
> > platform work?
> >     2. With this type of scenario, if I cannot use include, what
type
> > of options may I have?
> >
> > Anything is appreciated.
> 
> ---8<--- snip
> 
> > > >  This is the error I got:
> > > >
> > > > Warning: include() [function.include]: URL file-access is
> disabled
> > in
> > > the server configuration in C:\Inetpub\wwwroot\read.php on line 29
> > > > Warning: include(http://www.mysite.com/calculate.php)
> > > [function.include]: failed to open stream: no suitable wrapper
> could
> > be
> > > found in C:\Inetpub\wwwroot\read.php on line 29
> > > > Warning: include() [function.include]: Failed opening
> > > 'http://www.mysite.com/calculate.php' for inclusion
> > > (include_path='.;C:\php5\pear') in C:\Inetpub\wwwroot\read.php on
> > line
> > > 29
> 
> ---8<--- snip
> 
> > If you are trying to include() a remote file via HTTP, the remote
> > server
> > will (most likely) translate the PHP code into the output that it
> would
> > produce if you were to visit the script with a web browser. It
> appears
> > you are trying to grab a PHP file from a remote server and execute
it
> > as
> > code, which won't work--at least not under normal circumstances.
> 
> Alice,
> 
> If the two Windows machines are on the same network, you can try to
use
> Windows' file sharing to do the job for you. For instance,
> 
> include('\\servername\dirname\filename.php');

*cough* ... I meant to double up on those backslashes. I'm not sure if
PHP supports forward-slash file/dir specifications in Windows, but to
double them all up would look like this:

Include("\\\\servername\\dirname\\filename.php");
 
> Using HTTP from Windows to Windows would yield the same results as
> using
> HTTP from Linux to Windows. You could host the files on a server that
> does not parse PHP, and so they would be transmitted as plain text...
> but then you get into issues of disclosing their contents to parties
> you
> would rather leave in the dark (read: hackers).
> 
> You might consider using FTP, SCP, or another behind-the-scenes file
> transfer agent to accomplish what it is you're trying to do. I believe
> PHP already has several functions for use with FTP.


Todd Boyd
Web Programmer




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux