I've got a php include, with a path going to [root]/Edge-animations/splash/publish/web/splash.php
, a valid path on my server. On my first attempt, I got an error saying that the path is invalid; it turned out that I need to put the complete server path (along the lines of /homepages/3/d426847376/htdocs/Edge-animations/splash/publish/web/splash.php
). After correcting the link, I tried reloading my page; it didn't show an error, but it didn't show the file it was supposed to include, either. My PHP syntax is as follows:
<?php include('/homepages/3/d426847376/htdocs/Edge-animations/splash/publish/web/splash.php'); ?>
And matches the syntax I used for a working PHP include on another page. What am I doing wrong?
EDIT
The included file is an HTML file outputted by Edge; I changed the extension from .html to .php. Here's its code:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled</title>
<!--Adobe Edge Runtime-->
<meta http-equiv="X-UA-Compatible" content="chrome=IE8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/chrome- frame/1/CFInstall.min.js"></script>
<script type="text/javascript" charset="utf-8" src="splash-v1_edgePreload.js"> </script>
<style>
.edgeLoad-Splash { display:none; }
</style>
<!--Adobe Edge Runtime End-->
</head>
<body style="margin:0;padding:0;">
<div id="Stage" class="Splash">
</div>
</body>
</html>
I've also now added parentheses and a semicolon to the link; it still doesn't work.
Just for testing purposes try
<?php
$path = '/homepages/3/..........';
ini_set('display_errors', true);
error_reporting(E_ALL);
echo 'path=',$path, "<br />\n";
if ( !file_exists($path) ) {
die('no such file');
}
else {
//include $path;
echo '<p>opening file</p>';
$fp = fopen($path, 'rb');
if ( !$fp ) {
die('open failed');
}
echo '<p>reading file</p>';
$content = stream_get_contents($fp);
if ( false===$content ) {
die('read failed');
}
echo '<p>strlen(content)=',strlen($content), '<p>';
}