Help with rotator script error

This is a discussion on Help with rotator script error within the PHP Language forums, part of the PHP Programming Forums category; It was working fine on the test server. loaded it onto iis6 server after installing php and got everything working (...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-06-2004
Carolyn Gill
 
Posts: n/a
Default 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>";
?>



Reply With Quote
  #2 (permalink)  
Old 09-06-2004
Jasper Bryant-Greene
 
Posts: n/a
Default Re: Help with rotator script error

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
Reply With Quote
  #3 (permalink)  
Old 09-06-2004
Carolyn Gill
 
Posts: n/a
Default Re: Help with rotator script error

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" <jasperbg@gmail.com> wrote in message
news:0CS_c.22354$N77.969590@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



Reply With Quote
  #4 (permalink)  
Old 09-06-2004
Gary L. Burnore
 
Posts: n/a
Default Re: Help with rotator script error

On Sun, 5 Sep 2004 23:17:21 -0700, "Carolyn Gill"
<carol@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" <jasperbg@gmail.com> wrote in message
>news:0CS_c.22354$N77.969590@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
================================================== =========================
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:01 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0