Banner Rotator | failed to open stream
Posted: Mon Jul 26, 2010 11:55 pm
I'm trying to build a simple php snippet that will switch the main banner every time the home page is loaded/refreshed. I'm using the 'include' function to link to the external php file with the code.
I am receiving this error message:
Warning: include(.:content_rotation.php) [function.include]: failed to open stream: No such file or directory in /home2/incomeq0/public_html/maxwellink/index.php on line 58
Warning: include() [function.include]: Failed opening '.:content_rotation.php' for inclusion (include_path='.:/usr/lib64/php:/usr/lib/php') in /home2/incomeq0/public_html/maxwellink/index.php on line 58
website:http://www.maxwellink.net
Here is the PHP I have in my index.php file:
Both the HTML files and PHP files are located in the root folder.
Here is the PHP in the file "content_rotation.php":
I have set the permissions of the content_rotation.php and index.php to 700. I read that in a similar post.
I'm pulling my hair out over here...I need a beer
Thanks for the help
~z
I am receiving this error message:
Warning: include(.:content_rotation.php) [function.include]: failed to open stream: No such file or directory in /home2/incomeq0/public_html/maxwellink/index.php on line 58
Warning: include() [function.include]: Failed opening '.:content_rotation.php' for inclusion (include_path='.:/usr/lib64/php:/usr/lib/php') in /home2/incomeq0/public_html/maxwellink/index.php on line 58
website:http://www.maxwellink.net
Here is the PHP I have in my index.php file:
Code: Select all
<?php
$content_rotation_list = array(
".:hm_bn_1.html",
".:hm_bn_2.html"
);
?>
//v v v v v This is Line 58 v v v v v
<?php include(".:content_rotation.php");?>Here is the PHP in the file "content_rotation.php":
Code: Select all
<?php
if (isset($content_rotation_list)
&& is_array($content_rotation_list)
&& count($content_rotation_list) > 0) {
srand(time());
include($content_rotation_list[rand(0,count($content_rotation_list)-1)]);
}
?>I'm pulling my hair out over here...I need a beer
Thanks for the help
~z