Include Function help

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
bomanda
Forum Newbie
Posts: 2
Joined: Thu Mar 13, 2008 12:05 pm

Include Function help

Post by bomanda »

I'm new to PHP. I am using a php photo gallery script. I want to include a specific category on a page specific to a certain category in my photo gallery.

I usually would just put the following to include my entire photo gallery on a page:

<?php @include_once( $_SERVER["DOCUMENT_ROOT"]."/gallery/index.php" ); ?>

But what I really want to do is something more like this that would only display a certain category in my photo gallery:

<?php @include_once( $_SERVER["DOCUMENT_ROOT"]."/gallery/index.php?gazpart=show&gazgal=1" ); ?>

but when I use this code, my photos do not display. Any suggestions?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Include Function help

Post by Christopher »

Do:

Code: Select all

<?php
$gazpart = 'show';
$gazgal = 1;
@include_once( $_SERVER["DOCUMENT_ROOT"]."/gallery/index.php" );
?>
(#10850)
kryles
Forum Contributor
Posts: 114
Joined: Fri Feb 01, 2008 7:52 am

Re: Include Function help

Post by kryles »

wait, the import grabs the GET values? how is that :?
bomanda
Forum Newbie
Posts: 2
Joined: Thu Mar 13, 2008 12:05 pm

Re: Include Function help

Post by bomanda »

Thanks for the suggestion, unfortunately I can't get it to import the values.

Take a look here:
http://www.campanjigami.com/gallery/fish/

When going to the above address, I want it open the "Fish" category, not the individual categories as shown.

Also, just as a side note, I changed the gazgal value to "6" for the Fish Category.
Post Reply