Issue
I'm building a website on Dreamweaver using PHP and its only the start of it. include_once doesn't show the image. It only shows PHP in the design tab.
I've tried include also but that is also not working. I've tried for other files too, still the same problem.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The Pickzone</title>
<link rel="stylesheet" href="style/style.css" type="text/css" media="screen" />
</head>
<body>
<div align="center" id="mainWrapper">
<?php include_once('template_header.php');?>
<div id="pageContent">test</div>
<?php include_once('template_footer.php');?>
</div>
Solution
Try adding __DIR__
in front of your includes to provide the full path on the disk. E.g. /var/www/path/to/file/on/disk/
.
<?php include_once __DIR__ . 'template_header.php';?>
<div id="pageContent">test</div>
<?php include_once __DIR__ . 'template_footer.php';?>
See the php documentation for more information.
Answered By - Tom Answer Checked By - Marilyn (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.