Help with an include script (&pageX)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Help with an include script (&pageX)

Post by JKM »

Hi there!

I'm lookin' for a PHP include script that shows pageX with &pageX. I've got a sucky script for it, but I have to write &page=X, and it includes both p=index and page=X. So if you guys could help me out here, I would be greatfull.

JKM.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Help with an include script (&pageX)

Post by John Cartwright »

Your going to have to explain a bit better. I really didn't get much of your explanation. :(
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: Help with an include script (&pageX)

Post by JKM »

Hmm. I wan't a script where I can show pages like this:
images.php?gallery=Toronto -----> Should show Toronto.php
images.php?gallery=Toronto&page2 ------> Should show Toronto_page2.php
images.php?gallery=Australia&page3 ------> Should show Australia_page3.php
and so on..
ragnis12
Forum Newbie
Posts: 12
Joined: Tue Jun 17, 2008 4:14 am

Re: Help with an include script (&pageX)

Post by ragnis12 »

Code: Select all

<?php
 
    if($_GET['gallery']){
        $page = (isset($_GET['page'])) ? '_'.$_GET['page'] : '';
        if(file_exists($_GET['gallery'].$page.'.php')){
            include $_GET['gallery'].$page.'.php';
        }else{
            echo 'File not found';
        }
    }
?>
if you write index.php?gallery=toronto tehn will be included toronto.php
if you write index.php?gallery=toronto&page=2 then will be included toronto_2.php
if you write index.php?gallery=toronto&page=page2 then will be included toronto_page2.php

I hope you understand.
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: Help with an include script (&pageX)

Post by JKM »

Thx alot, but isn't it possible to get &page2, not &page=page2? :-)
ragnis12
Forum Newbie
Posts: 12
Joined: Tue Jun 17, 2008 4:14 am

Re: Help with an include script (&pageX)

Post by ragnis12 »

no, it's not possible
User avatar
Greenconure
Forum Commoner
Posts: 30
Joined: Mon Jun 16, 2008 8:19 am

Re: Help with an include script (&pageX)

Post by Greenconure »

JKM wrote:Thx alot, but isn't it possible to get &page2, not &page=page2? :-)
You could; however, use "&page=2"
JKM
Forum Contributor
Posts: 221
Joined: Tue Jun 17, 2008 8:12 pm

Re: Help with an include script (&pageX)

Post by JKM »

How can I make it work like this:
?gallery=toronto&order=taken

order=added should have the value "$result = mysql_query("SELECT * FROM gallery ORDER BY LCASE(added) ASC, added DESC");"

order=size should have the value "$result = mysql_query("SELECT * FROM gallery ORDER BY LCASE(size) ASC, sizeDESC");"

and so on..
Post Reply