Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2004, 12:03 PM
Registered User
 
Join Date: Feb 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to dean_custom
Default Rotating images with PHP

Ok, i'm not even sure if this is possible...but hey...ask anyway.

Is it possible to create a rotating image using PHP??

My friend used ColdFusion to accomplish this, but I would like to use PHP if at all possible.

Please!.... Let it be possible and PLEASE... let someone here know the code!!

-DeanCustom

 
Old March 19th, 2004, 06:08 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Sorry...

PHP runs on the server. PHP can do NOTHING once the page is already loaded.
However, you could echo a rotating banner.
Just echo some JavaScript like this:
http://javascript.internet.com/misce...e-rotator.html

Also, you could make an animated GIF (what I do).

HTH,

----------
---Snib---
----------

<><
 
Old March 23rd, 2004, 10:10 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, what do you mean image rotator? do you mean that every time you load a web page, a different image is displayed?

That's definitely do-able. Count the number of images you have, pick a (random) number between 1 and the number of images, and display that one.

By display, I mean generate the appropriate <img> tag that identifies the randomly selected image.


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting images from a directory using php Adam H-W Beginning PHP 1 June 7th, 2006 08:57 AM
uploading images with PHP Adam H-W PHP How-To 1 May 30th, 2006 10:11 AM
Displaying images stored in MySQL through in PHP trufla PHP Databases 3 May 2nd, 2006 04:55 AM
Does anyone know a java script for rotating images DSteven Javascript How-To 1 August 21st, 2005 04:48 AM
php - rotating text cat PHP How-To 6 December 14th, 2004 06:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.