cool script but how?

This is a discussion on cool script but how? within the PHP Language forums, part of the PHP Programming Forums category; http://camacho.tv/index.php When you click the picture banner on top of the page, it opens a new ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-30-2004
Kris
 
Posts: n/a
Default cool script but how?

http://camacho.tv/index.php

When you click the picture banner on top of the page, it opens a new
picture. I really like this and I wish I could have it on my site.
I'm not really into programming and web development, but nonetheless, I'm
hoping that I can accomplish this with some sort of tool maybe?

Can anyone give me a tip on how to do this? Or do you know other sites where
you can see the same thing?

many thanks!
Kris


Reply With Quote
  #2 (permalink)  
Old 11-01-2004
Justin Koivisto
 
Posts: n/a
Default Re: cool script but how?

Kris wrote:
> http://camacho.tv/index.php
>
> When you click the picture banner on top of the page, it opens a new
> picture. I really like this and I wish I could have it on my site.
> I'm not really into programming and web development, but nonetheless, I'm
> hoping that I can accomplish this with some sort of tool maybe?
>
> Can anyone give me a tip on how to do this? Or do you know other sites where
> you can see the same thing?


It looks like it just randomly chooses a file to display when the PHP is
executed. I've done this before, and it goes something like this:

<?php
$select=array(
'image1.jpg',
'image2.jpg',
'image3.jpg',
);
$display_img=$select[array_rand($select,1)];
?>

--
Justin Koivisto - spam@koivi.com
http://www.koivi.com
Reply With Quote
  #3 (permalink)  
Old 11-02-2004
Shawn Wilson
 
Posts: n/a
Default Re: cool script but how?

Kris wrote:
>
> http://camacho.tv/index.php
>
> When you click the picture banner on top of the page, it opens a new
> picture. I really like this and I wish I could have it on my site.
> I'm not really into programming and web development, but nonetheless, I'm
> hoping that I can accomplish this with some sort of tool maybe?


Make a directory that contains only images you want to display.

Code stolen and mangled from Chung's post:
$file = array_rand(glob("path/to/files/*.jpg"));
echo '<a href="filename.php"><img src="'.$file.'"></a>';



Shawn
--
Shawn Wilson
shawn@glassgiant.com
http://www.glassgiant.com
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:20 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0