Full URL not working with php include

php, php-include

Solution

`include` is meant to include and evaluate a specified PHP file. If you fetch it locally, it can be processed like PHP - if you fetch it through a full URL, you will get the resulting HTML (in theory ... you may get only an error).

Supporting Docs

include 'menu.php' //Internally process a PHP file to generate HTML

or

file_get_contents('http://domainname.com/menu.php'); //Fetch resutling HTML

Problem

So, I am trying to insert a file with a php include, but for some reason it doesn't work with the full URL. This works: `<?php include 'menu.html' ?>` But this does not: `<?php include 'http://domainname.com/menu.html' ?>` Any ideas?

Original source