NameSilo

Photos

Spaceship
Watch
Impact
0
Ive been looking at some sites where photos are posted and was interested in a few sites that ended like .php?showimage=1 and i was looking for a script just like it.

The picture on the site also was a link to .php?showimage=. The number after = was the number below the current one and it was like this for all the photos.

Does anyone know a script like this and can give it to me for free?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Its a php Nav script.

PHP:
<?php include("$images.jpg");

?>

On showimages.php, you put the html code of the page, the template. then where you want the image to go you put the code above in.

Then you just link like this.

showimages.php?images=filename

or if the images are in a folder called pics then like this

showimages.php?images=pics/filename

hope that helps. if you need any more help contact me. and I can maybe do it for you.

PJ
 
0
•••
Note that you would need to confirm that the path given in the url is a valid local and allowed path for what was posted above not to be a security hazard.
 
0
•••
How do i make it a changing number for each photo

For instance when my page is viewing photo 9 the photo should also be a link to 8 and when my photo is on 8 then there shoulb be a link to 7
 
0
•••
Add the following code for the links

PHP:
<a href="<?=($image-1)?>">Previous</a>
<a href="<?=($image+1)?>">Next</a>
 
0
•••
could some1 give me the whole code please
 
0
•••
0
•••
I would recommend you to go to hotscripts.com or similar site and search for image galleries software to use. There are a good number of free and good software available for that.
 
0
•••
actually i would really!!!!! like to make it by myself and could use some assistence
 
0
•••
If you want the images numbered, ie. 1, 2, ,3... then I would suggest a scheme of naming the images as such.. eg. the 2nd Image is img00002, nth image img0000n, etc.... If not, then you will haveto use some sort of indexing method.. i.e. db or a file. ( complicated but not impossible)

In the following code I have assumed that the images are according to the numbering scheme mentioned initially.. and that all the images havethe same extension. (jpeg)


PHP:
<?

$imgNo = $_GET['imgNo'];

$imgNo = ($imgNo ? $imgNo:1);

if ($imgNo == 1)
{
    $urlPrev = "Start";
}else
{
    $imgPrevNo = $imgNo - 1;
    $urlPrev = "<a href=".$_SERVER['PHP_SELF']."?imgNo=".$imgPrevNo."> Previous</a>";
}


if ($imgNo == $las) // Here $las is the total no of images that you have. 
                          //Could be in the conf.php file
{
    $urlNext = "End";  
}else{
  $imgNextNo = $imgNo + 1;
  $urlNext = "<a href=".$_SERVER['PHP_SELF']."?imgNo=".$imgNextNo."> Next</a>";
}

?>
<html>
<body>
<table>
<tr>
<td>
<?=$urlPrev;?>
</td>
<td>
<?=$urlNext;?>
</td>
</tr>
<tr>
<td colspan=2>
<img src="imagefolder/img<?=str_pad($imgNo,5,"0", STR_PAD_LEFT)?>.jpeg">
</td>
</tr>
</table>
</body>
</html>

Edited Many times. Added a padding function for easier maintainability of the images.
 
Last edited:
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back