What does banner mean? Banner Program

Source: Internet
Author: User
/* banner.php
This PHP3 rolling program is designed by Anton Olsen (aolsen@graphweb.com), you are free to modify and use this program, and freely spread it, if you have more important changes to it, please write an e-mail.
In this program, the author attempts to implement this function in many different ways, but the image function in PHP does not show the animated GIF image format and the operation of this format (such as: fopen, Fpassthru, and Fclose). The author uses the PassThru method to implement it, although this is not the best approach, but it can display the banner more quickly than other methods.
In this procedure, we assume that:
1. You already have a directory that stores all of your advertising images.
2, all the advertising images are in GIF format.
3. All GIF images start with banner.
3. There are no other files in this directory except for advertising images.
Install this program:
1, put this program and all the advertising pictures (*. GIF) into a directory.
2. Put the following HTML code on your Web page:



4/14/2000 Mouse Chen (litmouse@km169.net) Translate it to Chinese
*/
/* Random ($max integer)
Returns a random number from 0 to $max-1;
*/
function Random ($max)
{
$x = rand ();
$y = Getrandmax ();
$r = $x/$y * ($max-1);
$r = Round ($r + +);
return $r;
}
/* Read the directory and read all the "banner*" files into an array; */
$i = 0;
$d = Dir (".");
while ($entry = $d->read ())
if (substr ($entry, 0,6) = = "banner")
$array [$i + +] = $entry;
$d->close ();
/* Select a random number */
$r = random ($i);
/* Send a No-cache and GIF file header, and output the picture. */
Header ("Pragma:no-cache");
Header ("Expires:monday 01-jan-80 12:00:00 GMT");
Header ("Content-type:image/gif");
PassThru ("Cat $array [$r]");
?>

The above describes what banner means banner program, including what is the meaning of banner content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.