FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Include gives warning
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Include gives warning [message #184305 is a reply to message #184303] Sat, 21 December 2013 19:24 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Derek Turner wrote:

> On Sat, 21 Dec 2013 10:36:29 -0500, richard wrote:
>> <?php include "http://mroldies.net/artists/".$year."artists.php";
>>
>> […]
>
> RTFM on the correct way to use include. HINT it has to be the true path to
> a file on your server.

No, it does not; it does not even have to be a regular file. However, if
the above is to work, several conditions have to apply:

- allow_url_fopen = 1 (default),
allow_url_include = 1 (the default is 0);

- Either PHP must not parse the resource accessed like that or it must
generate from the parsed resource a PHP script resource;

- The Web server (hardware) must be able to resolve the domain name to an IP
address, using its DNS client (software).

And it still would be comparably inefficient because of the unnecessary
roundtrip.

,-<http://php.net/include>
|
| If "URL include wrappers" [1] are enabled in PHP, you can specify the file
| to be included using a URL (via HTTP or other supported wrapper - see
| Supported Protocols and Wrappers [2] for a list of protocols) instead of a
| local pathname. If the target server interprets the target file as PHP
| code, variables may be passed to the included file using a URL request
| string as used with HTTP GET. This is not strictly speaking the same thing
| as including the file and having it inherit the parent file's variable
| scope; the script is actually being run on the remote server and the
| result is then being included into the local script.
|
| [1] < http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-inc lude>
| [2] <http://www.php.net/manual/en/wrappers.php>
|
`----


PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: when incuding a page
Next Topic: php double form submit prevent
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Mon Nov 25 04:08:13 GMT 2024

Total time taken to generate the page: 0.04535 seconds