Posted by clog Mon 12th Mar 2007 15:12 - Syntax is PHP - 79 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
  1.  
  2. function getBanner()
  3. {
  4.     $tempdir = getcwd();
  5.     chdir('images/banners');
  6.     $banners = glob('*.*');
  7.     chdir($tempdir);
  8.  
  9.     $lastBanner = (!empty($_SESSION['bannerImage'])) ? $_SESSION['bannerImage'] : '';
  10.     $newBanner = $banners[rand(0,count($banners)-1)];
  11.     while ($newBanner == $lastBanner)
  12.         $newBanner = $banners[rand(0,count($banners)-1)];
  13.  
  14.     $_SESSION['bannerImage'] = $newBanner;
  15.     return $newBanner;
  16. }
  17.  
  18. ?>

PermaLink to this entry https://pastebin.co.uk/11767
Posted by clog Mon 12th Mar 2007 15:12 - Syntax is PHP - 79 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0