472,796 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,796 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 1917
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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.