I have this problem, I have a txt file that I want to be included and I use this:
include ("http://www.mysite.com/file.txt");
and it does not seem to work
Any help will be highly appreciated!
Thank you
what is the error you are getting?
hello, did you include <? ?>
i.e
<? include ("http://www.mysite.com/file.txt");?>
Are you using your local hard disk to use the PHP, because even I can't figure out how to use it. Try uploading the php file to your host (which I assume uses PHP) and use this:
<?php include ("whetevr.txt"); ?>
May this be the solution?
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using an URL (via HTTP or other supported wrapper - see Appendix I 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 an 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. Warning Windows versions of PHP prior to PHP 4.3 do not support accessing remote files via this function, even if allow_url_fopen is enabled.
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using an URL (via HTTP or other supported wrapper - see Appendix I 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 an 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.
Warning Windows versions of PHP prior to PHP 4.3 do not support accessing remote files via this function, even if allow_url_fopen is enabled.
Quote from PHP Manual
If you are running PHP on your machine and you are using windows and less than php version 4.3 then you need to upgrade.