Connecting Tech Pros Worldwide Help | Site Map

cool script but how?

  #1  
Old July 17th, 2005, 10:22 AM
Kris
Guest
 
Posts: n/a
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


  #2  
Old July 17th, 2005, 10:23 AM
Justin Koivisto
Guest
 
Posts: n/a

re: cool script but how?


Kris wrote:[color=blue]
> 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?[/color]

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
  #3  
Old July 17th, 2005, 10:24 AM
Shawn Wilson
Guest
 
Posts: n/a

re: cool script but how?


Kris wrote:[color=blue]
>
> 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?[/color]

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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Python - why don't this script work? Ohmster answers 10 October 24th, 2007 08:05 AM
Call .Net Webservice from server side script on an ASP only server Mr Bojangles answers 1 March 7th, 2006 12:55 PM
Embedding a binary file in a python script mrstephengross answers 8 February 21st, 2006 12:05 AM
Script to calculate remaining minutes hupjack answers 4 July 19th, 2005 06:04 AM