adding dynamic content to index.template.php

Started by BuzzBoy, December 15, 2005, 01:47:08 AM

Previous topic - Next topic

BuzzBoy

Hi - I have three php content files...I tried various methods of include with out success - well sort of. I was able to display one of the files, but what i am trying to do is have it so the user would click a link and say content #1 shows, click on another and #2 will show in place of #1, etc and so on for #3. reloading the page to show content is ok - I wanted to use a drop down menu for the links...the menu is not the issue it was the include array i was having trouble with...

<?
 
  if (strstr ($_GET["info"], 'q')) include('../content2.php');
elseif (strstr ($_GET["info"], 'p')) include('../content3.php');
elseif (strstr ($_GET["info"], 'o')) include('../content4.php');
else include('content1.php')

?>


the link looks like http://www.site.com/folder/index?info=q

Anyone please help...
Thank you.

BuzzBoy

...does anyone have any suggestions? This code works in other php pages of my site, but not in the index.template.php of SMF.

Thanks

bloc

Are the paths to the content pages the right ones? Maybe you should include the whole path there instead.

BuzzBoy

Hi, I tried both ways for the path - I was able to include and show one file as an include , no prob, but when i tried to set it up this way it would not work...I got a template error  :( The code in the sample does work in any other php page of my site every time...but will not work from the index.template.php :(

BuzzBoy

Ok, ok...sorry! I found my dumb mistake - I have a bad cold right now and the meds just plain old got to me. Thank you for helping.

I did not need <? and ?>

Works perfectly as I wanted... 8) :P ;D
Cheers


Advertisement: