473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Help with rotator script error

It was working fine on the test server. loaded it onto iis6 server after
installing php and got everything working (after redirecting it to the
correct directory) except for 1 annoying error that I don't understand.

Any help would be appreciated - the sooner the better so I can get some
sleep tonight!
Undying gratitude to anyone willing to help a php beginner!

here's the page with the error http://www.ioworldwide.com/ and...

php code follows:
*<?php

$dir=opendir("/ioworldwide/rotator/");
//This is the directory route to the folder
$directory="rotator/";
//This is a relative link to the directory if it is not in the same
directory as the file you are displaying the images on

$pattern="\.(gif|jpg|jpeg|png|bmp|swf)$";
if(!$dir)
{
die("Failed to read directory");
}
$s=readdir($dir);
$count="0";
$image;
while($s)
{
if(ereg($pattern, $s))
{
$image[$count]=$s;
$count++;
}
$s=readdir($dir);
}
closedir($dir);

//Spit it out
$limit=count($image);
$limit--;
$randNum=rand(0,$limit);
$size=getimagesize("$directory$image[$randNum]");

$notSWF = "\.(gif|jpg|jpeg|png|bmp)$";
if( ereg( $notSWF , "$directory$image[$randNum]" ) )
echo "<br><img src=\"$directory$image[$randNum]\" $size[3]>";

else
echo "<OBJECT classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"

codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c
ab#version=6,0,0,0\" WIDTH=\"589\"

HEIGHT=\"165\" id=\"image_one\" ALIGN=\"\">
<PARAM NAME=movie VALUE=\"$directory$image[$randNum]\">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<param name=loop value=false>
<EMBED src=\"$directory$image[$randNum]\" quality=high bgcolor=#FFFFFF
WIDTH=\"589\" HEIGHT=\"165\"

NAME=\"$directory$image[$randNum]\" ALIGN=\"\"
TYPE=\"application/x-shockwave-flash\"

PLUGINSPAGE=\"http://www.macromedia.com/go/getflashplayer\">
</EMBED>
</OBJECT>";
?>

Jul 17 '05 #1
3 1945
Carolyn Gill wrote:
here's the page with the error http://www.ioworldwide.com/ and...


That isn't an error - simply a notice letting you know that that
variable hasn't been defined. Either put

$image = '';

at the top of your script to define $image before starting, or put

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);

at the top to hide such notices.

--
Jasper Bryant-Greene
Cabbage Promotions
Jul 17 '05 #2
Thank you so much! I can now get some sleep before the next crisis in my
life crops up :)
You're a lifesaver.

"Jasper Bryant-Greene" <ja******@gmail.com> wrote in message
news:0C********************@news.xtra.co.nz...
Carolyn Gill wrote:
here's the page with the error http://www.ioworldwide.com/ and...


That isn't an error - simply a notice letting you know that that
variable hasn't been defined. Either put

$image = '';

at the top of your script to define $image before starting, or put

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);

at the top to hide such notices.

--
Jasper Bryant-Greene
Cabbage Promotions

Jul 17 '05 #3
On Sun, 5 Sep 2004 23:17:21 -0700, "Carolyn Gill"
<ca***@cirrusspamlessinteractive.com> wrote:
Thank you so much! I can now get some sleep before the next crisis in my
life crops up :)
You're a lifesaver.
Give thanks by not top posting.

"Jasper Bryant-Greene" <ja******@gmail.com> wrote in message
news:0C********************@news.xtra.co.nz...
Carolyn Gill wrote:
> here's the page with the error http://www.ioworldwide.com/ and...


That isn't an error - simply a notice letting you know that that
variable hasn't been defined. Either put

$image = '';

at the top of your script to define $image before starting, or put

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT);

at the top to hide such notices.

--
Jasper Bryant-Greene
Cabbage Promotions


--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
DataBasix | ÝÛ³ºÝ³Þ³ºÝ³³Ýۺݳ޳ºÝ³Ý³Þ³ºÝ³ÝÝÛ³
| ÝÛ³ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ÝÛ³
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://signup.databasix.com
================================================== =========================
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: robert | last post by:
Hi Im stuck with an Ad Rotator problem. I'd be grateful to any assistance. Robert. Here's my code:
4
by: tmb | last post by:
I want to do a slide show with a script something like http://www.abiglime.com/webmaster/articles/jscript/021298.htm My Question: Will the client wait on all pic's in the slice show to be...
6
by: Andy | last post by:
I'm not sure why my checkbox code is not working as per intended. It always keeps saying "Please select the department" even though I check the department... appreciate any help. <!DOCTYPE HTML...
1
by: jonathanthio | last post by:
How do I create a page rotator? Is there a script for that? Also is there a way to do a page rotator that's not random but based on cookies. For example, if a new person see my website, it'll...
4
by: Leon | last post by:
I need an ad management system that record impressions and clicks as well as display gif, jpeg, and flash banners. I don't mind trying to build it myself, but I'm kind of press for time. do anyone...
3
by: Mark A. Sam | last post by:
Hello, Does anyone know of a third party ad rotator that automatically changes the images? It seems like the ad rotator in that comes with Visual Web Developer changes images only when the...
4
by: mmurphmsu | last post by:
I have setup the ad rotator on one of my companies pages. I have also setup the XML file just like it shows on MSDN. I have the AdvertisementFile Property of the rotator set to the XML file in the...
2
by: Excel 009 | last post by:
Hi All, I have the appended code which I used for a banner rotator. It works great except that there 1. there is a border which I do not want and 2. on top of the banner there is a black bar...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.