Page 1 of 1

I'm new and need help with .../whatever.php?page=0

Posted: Mon Mar 13, 2006 9:20 pm
by leigh
I'm really lost. I'm new at this and have been going through the tutorials but I just can't figure this one out. What I'm trying to do is...when you click on one of my menu buttons...say...'portfolio' it has a pop-up menu with 'option 1', 'option 2', and 'option 3'. Each option is a paragraph of text, which are separate php files. What I want is for all three paragraphs to show up if you click on the menu button and forget the pop-up menu. Right now I have display.php...which will be the page that will show up when you click 'portfolio' menu button (I think). If I click on 'option 1' it will show up as .../display.php?page=1...and bring up the paragraph I have on the 'option 1' php. I have this in an array but don't know how to put all three paragraphs together on the display page. I feel like I know the basic code but putting it all together is still very confusing. Could someone tell me exactly how they would do the code for this. If anyone can help...don't assume I know much of anything...*s*.Thanks.

Posted: Mon Mar 13, 2006 9:27 pm
by feyd
make the "portfolio" link an explode()-able link?

i.e. display.php?page=portfolio,1,2,3 or something...

I'm new and need help with .../whatever.php?page=0

Posted: Mon Mar 13, 2006 9:38 pm
by leigh
I'm not sure on how to write the arrays for all this...

Posted: Mon Mar 13, 2006 9:51 pm
by feyd
exploding $_GET['page'] on a comma will yield

Code: Select all

$show = array('portfolio','1','2','3');
I'm assuming you have the paragraphs stored in a single array. That makes display very simple

Code: Select all

foreach($show as $paragraphNumber)
{
  if(isset($paragraphs[$paragraphNumber]))
  {
    echo $paragraphs[$paragraphNumber];
  }
}

Posted: Mon Mar 13, 2006 9:58 pm
by leigh
It all makes sense when someone does it for me...thanks so much