944,117 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 2269
  • PHP RSS
Aug 19th, 2006
0

How to rotate top page banner using php

Expand Post »
Hai friends,


I am very confused this task. please help me.
if five banners are stored in one location , I want to displayall the banners simultaniously in my application.

How to rotate the webpage top banner ? In my application i am getting the immage details using database.

Please send me any idea.
__________________
Thanks
Vssp
Similar Threads
Reputation Points: 5
Solved Threads: 5
Junior Poster
vssp is offline Offline
197 posts
since Jul 2006
Aug 19th, 2006
0

Re: How to rotate top page banner using php

Here's a rough idea of one way you can do it.

PHP Syntax (Toggle Plain Text)
  1. function change($current_banner)
  2. {
  3. $number_of_banners = 5;
  4. if ($current_banner < $number_of_banners)
  5. {
  6. $current_banner++;
  7. }
  8. else
  9. {
  10. $current_banner = 0;
  11. }
  12. return $current_banner;
  13. }

PHP Syntax (Toggle Plain Text)
  1. function get_filename($current_banner)
  2. {
  3. select $current_banner
  4. {
  5. case 1:
  6. $filename = "thebannername.jpg";
  7.  
  8. ...
  9.  
  10. }
  11. }

PHP Syntax (Toggle Plain Text)
  1. //Display the banner
  2.  
  3. //Get filename
  4. $filename = get_filename($current_banner)
  5. //Use filename in HTML
  6. echo "<img src=\"" . $filename . "\">";
  7. //Go to next banner
  8. $current_banner = change($current_banner);
Reputation Points: 23
Solved Threads: 23
Posting Pro in Training
Puckdropper is offline Offline
494 posts
since Jul 2004
Aug 21st, 2006
0

Re: How to rotate top page banner using php

Thanks for your replay
Reputation Points: 5
Solved Threads: 5
Junior Poster
vssp is offline Offline
197 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Calling a PHP function from HTML menu
Next Thread in PHP Forum Timeline: PHP soon need to know more about FTP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC