Web Developers Forum & SEO Help
Web Developers ForumArticlesBlogLinks
topmenu

Programming and Scripts: Web Developers Forum

Go Back   TalkWebDev: Web Developers Forum for Web Designers & SEO Information > Web Development > Programming and Scripts
User Name
Password


Reply
 
Thread Tools Search this Thread
Old 05-03-2005, 06:06 PM   #1
Archaic Sage
Super Moderator
 
Join Date: Mar 2005
Location: England
Posts: 182

Send a message via AIM to Archaic Sage Send a message via MSN to Archaic Sage Send a message via Yahoo to Archaic Sage
Default More help -- PHP

I'm pretty crap really.

Anyway, I was wondering, if I wanted to display a series of images from a directory, by date upload how I would do this.

At the moment, I've got a simple script that will display an image, with the Next and Previous links automatically; however, it only displays by number. That script can be seen:

PHP Code:
<?php
$previous
=$image-1;
$next=$image+1;
$maxfile=10;
$minfile=1;
//image
if($image<$minfile) {echo ' ';}
else{if(
$image>$maxfile) {echo ' ';}
else{echo 
'<img src="'.$image.'.jpg">';}}
echo 
'<br />';
if(
$image>$maxfile){echo '<img src="'.$maxfile.'.jpg">';}
else
{echo 
'<a href="display.php?image='.$next.'">Next Image</a>';}
echo 
'<br />';
if(
$image<$minfile){echo '<img src="'.$minfile.'.jpg">';}
else
{echo 
'<a href="display.php?image='.$previous.'">Previous Image</a>';}
echo 
'</div>';
?>


But I find this inadequate for my newer needs, and I'd like to know how to rectify this situation.

Any help is greatly appreciated .

Archaic Sage
Archaic Sage is offline   Reply With Quote
Old 05-03-2005, 06:28 PM   #2
Purple Haze
TalkWebDev Enthusiast
 
Join Date: Mar 2005
Posts: 37

Default

Two things:

1. CLEAN UP YOUR CODE, I won't look at it because it's messy
2. Check this out for information on handling directories: http://php.net/manual/en/ref.dir.php

I'm assuming you didn't already look there, because the answer lies in that section of the PHP manual. Either that or I don't quite understand what you want.
__________________
Sticky Icky
Purple Haze is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mastering Regular Expressions in PHP Lars Programming 0 04-12-2005 11:13 PM
Pre-made script > PHP > Displaying Database Information Purple Haze Programming and Scripts 6 04-11-2005 10:00 PM
Pre-made script > PHP > Tell-a-Friend Script Purple Haze Programming and Scripts 4 04-05-2005 07:38 PM
Pre-made script > PHP > Uploading multiple files to a directory Purple Haze Programming and Scripts 0 03-30-2005 03:25 AM
php mysql tutorials Hoju Programming and Scripts 5 03-18-2005 04:45 PM


All times are GMT. The time now is 05:37 PM.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

 
Admin CP Mod CP About Us Contact Us Top