PDA

View Full Version : Gallery Script? php



Nug
October 26th, 2006, 10:53
I'd like to make an extremely simple gallery code!
I need to know how to write a php script, so when you click a button, it will change the image being shown? so if you have image 1 being shown it'll be changed to image 2?

If there are allready any good gallery scripts that could fit in the main area of: www.indigostudios.us please tell me:)

krakjoe
October 26th, 2006, 11:26
random images or in a certain order ?
also, where are the images coming from a database or filesystem ?

Nug
October 26th, 2006, 14:15
Filesystem, in order..

krakjoe
October 26th, 2006, 15:00
gimme a minute ....

krakjoe
October 26th, 2006, 15:10
<?php
session_start();
/*
* Set - me - up
**/
$images_dir = "images/";
$max_images = "3";
/////////////////////////
if (!isset($_SESSION['img'])) { $_SESSION['img'] = 1; }
if ($_SESSION['img'] == $max_images) { $_SESSION['img'] = 1; }
?>
<img src="<?=$images_dir.$_SESSION['img']; ?>.jpg"></img>
<?
$_SESSION['img']++;
?>


Is the most basic way I can think of ..... u wanna have more than one filetype ? or put the names of the images in ?

Nug
October 29th, 2006, 10:33
Wow, thanks Krak, I'll give it a try, nah, just jpg:D

edit, oh crap, i also need some gifs :cry2: