ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
PHP script (Wishlist)
PHP script // WishlistpineriverAug 24, 2002, 2:29am
If anyone knows where I could get a php image rotaion script that rotates
images in order not randomly and that uses image urls for like a tv station in active worlds, please contact me. Thanks ananasAug 24, 2002, 2:50am
For an explanation how the timer settings read thread
"TV Station Wish" (started 24 days ago). If your PHP installation has "fopen URL" enabled, it will work with exteral URLs if you leave all the docroot / basename stuff away and readfile() directly the array elements. [View Quote] pineriverAug 24, 2002, 6:24pm
so to be abale to have images urls I put $fopen url somewhare in the script?
> > If your PHP installation has "fopen URL" enabled, it will work > with exteral URLs if you leave all the docroot / basename stuff > away and readfile() directly the array elements. ananasAug 25, 2002, 3:13am
Allowing fopen() on URLs is a feature of PHP, that the admin
of your web server can enable or disable. You can find out all features that your admin allows with a simple script <?PHP phpinfo(); ?> The complete source using fopen of URLs would be like this <?PHP $aPics = array ( 'http://somehost.com/path/picture1.jpg', 'http://somehost.com/path/picture2.jpg', 'http://somehost.com/path/picture3.jpg', 'http://somehost.com/path/picture4.jpg' ); $DocRoot = './'; $i = time()%sizeof($aPics); Header ('Content-type: image/jpeg'); Header( 'Content-Disposition: attachment; filename=dummy.jpg' ); readfile ($aPics[i]); ?> If this does not work, you can still use forwarding : <?PHP $aPics = array ( 'http://somehost.com/path/picture1.jpg', 'http://somehost.com/path/picture2.jpg', 'http://somehost.com/path/picture3.jpg', 'http://somehost.com/path/picture4.jpg' ); $DocRoot = './'; $i = time()%sizeof($aPics); Header ('location: '.$aPics[i]."\n\n"); ?> [View Quote] pineriverAug 25, 2002, 10:51pm
I tryed both scripts, the first one said "<br />
<b>Warning</b>: readfile("") - Inappropriate ioctl for device " and the second script that I tryed just gave me a list of the files I had in the directory that I placed the php file > Allowing fopen() on URLs is a feature of PHP, that the admin > of your web server can enable or disable. > > You can find out all features that your admin allows with a > simple script > > <?PHP phpinfo(); ?> > > The complete source using fopen of URLs would be like this > > <?PHP > $aPics = array ( > 'http://somehost.com/path/picture1.jpg', > 'http://somehost.com/path/picture2.jpg', > 'http://somehost.com/path/picture3.jpg', > 'http://somehost.com/path/picture4.jpg' > ); > > $DocRoot = './'; > > > $i = time()%sizeof($aPics); > > Header ('Content-type: image/jpeg'); > Header( 'Content-Disposition: attachment; filename=dummy.jpg' ); > readfile ($aPics[i]); > ?> > > If this does not work, you can still use forwarding : > > > <?PHP > $aPics = array ( > 'http://somehost.com/path/picture1.jpg', > 'http://somehost.com/path/picture2.jpg', > 'http://somehost.com/path/picture3.jpg', > 'http://somehost.com/path/picture4.jpg' > ); > > $DocRoot = './'; > > > $i = time()%sizeof($aPics); > > Header ('location: '.$aPics[i]."\n\n"); > ?> ananasAug 26, 2002, 3:35am
The message from the first script must be what you get when
your PHP settings (server-side) don't allow URL fopen. There was one $ missing in the second script : Header ('Location: '.$aPics[$i]."\n\n"); I tried it now and it works (the $DocRoot line can be dropped). I just cannot test everything *g [View Quote] pineriverAug 26, 2002, 2:50pm
when I try the script, it loads the image file like the url location, so
when I load up the php file it loads up like http://oct31.de/obj/textures/frower01.jpg or the first image url on the list of the script, and not the php file and so it dose not refresh. It only displays a single pic in aw and in Internet explorer it reroutes me to the image url. [View Quote] ananasAug 26, 2002, 8:11pm
The reroute is normal, that's what happens when you forward.
Reloading in NetScape sent me a different picture everytime. If the reload really doesn't work, the current AW browser checks the redirect and reloads the redirected URL - in this case your only chance is to find a web space where the PHP feature "URL fopen" is enabled :( I have the script on my domain now and will experiment a little, maybe I'll find a trick (no success guaranteed). [View Quote] ananasAug 27, 2002, 4:27am
no luck with the forwarding :(
http://www.phparchiv.de/pages/Gratis_Speicherplatz_mit_PHP/ might help, a german page but links are links. They always mention the language near the listed provider link (if it isn't german). |