Jump to content

[SOLVED] include function


giggamosis

Recommended Posts

Hello All,

I have finally got my Apache server and php running now when i try to run one of my premade sites i get the following errors.

 

Warning: include(/sidebar.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 37

 

Warning: include() [function.include]: Failed opening '/sidebar.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 37

 

Warning: include(/main.php) [function.include]: failed to open stream: No such file or directory in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 38

 

Warning: include() [function.include]: Failed opening '/main.php' for inclusion (include_path='.;C:\php5\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\template.php on line 38

 

 

Please assist me with finding out what these errors mean and how to fix them. Thank you for your help.

Link to comment
https://forums.phpfreaks.com/topic/161324-solved-include-function/
Share on other sites

Are all the files you're refereneing in the same folder?

 

If so get rid of the forward slashes;

 

<table height=400 width=100% border=0>
  <tr>
    <td valign=top width=150><?php include("sidebar.php") ?></td>
   <td valign=top align=left><?php include($ContentFile) ?></td>
  </tr>
</table>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.