School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 357,969 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,562 people online right now.Registration is fast and FREE... Join Now!



generating pages

52 Weeks of Code Challenge: Android

Week #11 of the 52 Weeks of Code Challenge is Android, you should give it a shot. Click Here!

generating pages Rate Topic: -----

#1 cms247  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 21-February 09


Dream Kudos: 0

Posted 21 February 2009 - 06:01 AM

Hi,

I suspect this topic has been discussed on these boards before and I am just ignorant about the function names I should be searching the forum with....

Basically I'm in the process of building a photo gallery site.

I DO NOT WANT YOU TO DO MY HOMEWORK. HOWEVER I AM STUCK.

Within the gallery page include people will browse to a particular photographer and then the photos they have submitted in a given month.

When people browse to a given month, I don't want them to have to scroll up and down the photos submitted. I want each photo to sit on the gallery page as if it is framed by it. They can only view the next photo by clicking on the anchor for the next 'page'

My problem is I've never used php to loop through x amount of photos and print them on individual pages bfore.

What I mean is I want to be able to create anchors like:
1 2 3..
and if necessary
< first < previous ...22 23 24... next > last >

Can anyone guide me to a thread or tutorial where this issue has been discussed. Or could any educate me about the php script used in such circumstance?

Thanks

This post has been edited by cms247: 21 February 2009 - 06:03 AM

Was This Post Helpful? 0
  • +
  • -


#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • Icon

Reputation: 210
  • View blog
  • Posts: 2,405
  • Joined: 08-August 08


Dream Kudos: 100

Expert In: PHP

Re: generating pages

Posted 21 February 2009 - 07:52 AM

Read up on loops and arrays:
http://www.php.net/for
http://www.php.net/foreach
http://www.php.net/while
http://www.php.net/dowhile

http://www.php.net/m...n/ref.array.php
Was This Post Helpful? 0
  • +
  • -

#3 programble  Icon User is online

  • eats stacks for breakfast
  • Icon

Reputation: 14
  • View blog
  • Posts: 997
  • Joined: 21-February 09


Dream Kudos: 100

Re: generating pages

Posted 21 February 2009 - 10:40 AM

You could use the GET method to pass an index of the image, so you would have something like this:
http://www.website.c...age.php?index=4

I don't know how you would get the image, because I do not know how they are stored, are you using a MySQL DB?
Was This Post Helpful? 0
  • +
  • -

#4 cms247  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 21-February 09


Dream Kudos: 0

Re: generating pages

Posted 21 February 2009 - 11:10 AM

Hi programmable,

paths to the the images will be stored in a MySQL database

I'll be using a select query to get the monthly photos and like CTphpnwb suggested a loop to generate the pages....

I've got a bit of work to do before I get to that stage but at least more of the necessaries are ticking over in my mind somewhere now!
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month