04-23-2006, 07:17 PM | #1 (permalink) |
Loves my girl in thongs
Location: North of Mexico, South of Canada
|
{PHP} Prev Next code for a gallery
Edit: Got it working. Please see my post below. I edited the php in this post to show the working function.
Reference Page: http://www.arch13.com/index.php?id=brewery&id2=2 I have a function I found that I can't seem to modify to save my life. I'd like to humbly ask for help from the TFP members... I am trying to get a page to print < 1 >, where clicking on either "arrow" takes you to the next page (In this case an image) The first error occurs at line two, where it does not like the "{" The basic code follows: PHP Code:
PHP Code:
Mostly syntax based. I'm what they call "Know just enough to screw it up" I just want next and previous links for a photo gallery!
__________________
Seen on an employer evaluation: "The wheel is turning but the hamsters dead" ____________________________ Is arch13 really a porn diety ? find out after the film at 11. -Nanofever Last edited by arch13; 04-25-2006 at 06:43 PM.. |
04-25-2006, 10:29 AM | #2 (permalink) | |
Insane
|
Quote:
You could always wrap your conditions in brackets to isolate them from any other tests. That's what I do, anyway. It makes it easier to read and understand what is being tested. One thing I do to make sure I'm debugging the correct code (sometimes PHP errors are hard to track because of the output you actually get on your page) is just insert "print "boo"" or whatever to track where in the execution pipeline my code is at the moment. PHP is pretty good at telling you what line number it messed up on, but sometimes is the line you don't have to change to debug your program.
__________________
"You looked at me as if I was eating runny eggs in slow motion." - Gord Downie of The Tragically Hip |
|
04-25-2006, 05:53 PM | #3 (permalink) |
Loves my girl in thongs
Location: North of Mexico, South of Canada
|
I got the function working.
It's located here: http:www.arch13.com/prevnext.php The code to print the links is: PHP Code:
I edited the first post to show the function in a working form. Any ideas are greatly appreciated.
__________________
Seen on an employer evaluation: "The wheel is turning but the hamsters dead" ____________________________ Is arch13 really a porn diety ? find out after the film at 11. -Nanofever Last edited by arch13; 04-25-2006 at 06:42 PM.. |
04-26-2006, 01:55 PM | #4 (permalink) |
Insane
|
Quick and dirty? Take out the code that references the actual prev/next page numbers leaving the code that displays or appends the current page number to the line of HTML you output from that function.
__________________
"You looked at me as if I was eating runny eggs in slow motion." - Gord Downie of The Tragically Hip Last edited by trache; 04-26-2006 at 01:58 PM.. |
05-01-2006, 12:35 PM | #5 (permalink) | |
Loves my girl in thongs
Location: North of Mexico, South of Canada
|
Quote:
This seems to be what prints the adjoining numbers to the current page. PHP Code:
__________________
Seen on an employer evaluation: "The wheel is turning but the hamsters dead" ____________________________ Is arch13 really a porn diety ? find out after the film at 11. -Nanofever |
|
Tags |
code, gallery, php, prev |
|
|