Jump to content

Recommended Posts

Hi there, I want to include this page:

 

http://burningviolet.com/layouts/include.php

 

in http://burningviolet.com/header.inc

 

When I do that, I get:

 

Warning: opendir(cat/) [function.opendir]: failed to open dir: No such file or directory in /home/burning/public_html/layouts/include.php on line 22

 

However, when I go to the include.php page, it works. Can someone help?

 

Here's the include.php code:

 

<?php
/*

Copyright 2007 S. Benjamin
Your Membership grants you the right to use this script 
You may modify this script to suit your needs, but you can not resell this script
You are not allowed to give this script away, or resell this script or any part of it.

Unauthorized sale or redistribution of this script will result in account
termination without refund, and possible legal actions!

Contact info: [email protected]

http://www.creativeaftermath.com

*/


//////Build Catergories//////
$cats = array();

if ($handle = opendir($path."cat/")) {

    while (false !== ($file = readdir($handle))) {
if(($file != ".")&&($file != "..")){
	array_push($cats, $file);
	}
    	}

    closedir($handle);
}
////End Build Catergories////

/////Build Nav/////
$cat_count=1;

foreach($cats as $cat){
$cat_strip = trim(preg_replace('/[^a-zA-Z]/', ' ', $cat));
echo '  <a href="'.$site_url.'index.php?id='.$cat.'&page=1">'.ucfirst($cat_strip).'</a>  '."\n";}

/////End Build/////




?>

 

I'm guessing this is a quick fix. Can anyone help? :P

 

Thanks!

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.