Jump to content

If in directory


Crew-Portal

Recommended Posts

Hi I am adding Forums to my website using the PHPbb. Now I have edited it so that the tables width is 750 pixels just large egnoph to fit inbetween my 2 colums on the left and the right. But my problem is that every link I press removes theese colums and goes into a full screen view. So i was wondering how I would make it so that the PHP reads it as if when I open a link thats in a directory it puts in inbetween the colums! confused? This is what I got so far and tell me if it is right?!

 

<?php
$forum = $_GET['forum'];
if (in_dir(./forums/)){
include $forum . '.php';
}
else echo 'Your Not In The Right Place';
?>

 

I understand that code is wrong in fact I just made it up as I went along but I think I am on the right track?! Can someone help me?!?!?  :D

Link to comment
Share on other sites

I want an index page that if I post a link to something like /forums it will automatically display that info in a table like

 

-----------------------------------------

|              |                        |            |

|  SideBar  |  Forums Forums  |  SideBar  |

|  SideBar  |  Forums Forums  |  SideBar  |

|  SideBar  |  Forums Forums  |  SideBar  |

|  SideBar  |  Forums Forums  |  SideBar  |

|  SideBar  |  Forums Forums  |  SideBar  |

|  SideBar  |  Forums Forums  |  SideBar  |

|  SideBar  |  Forums Forums  |  SideBar  |

|  SideBar  |  Forums Forums  |  SideBar  |

|              |                        |            |

------------Powered By PhpBB------------

 

But it will only put .php docs in the middle table if they are in the directory /forums otherwise it will open them like a normal link!

Link to comment
Share on other sites

Sorry it does sound confusing let me put it this way!

 

If I want to call a certain link through A href= and if that .php file is in a folder called forums/ it doesnt load the script but displays a message like "Sample text".

 

Can you make a script that does that? That is not exactly waht I want it to do but with those guidelines I believe I have egnouph PHP experience to mod it to what I need

Link to comment
Share on other sites

If I want to call a certain link through A href= and if that .php file is in a folder called forums/ it doesnt load the script but displays a message like "Sample text".

 

No. A link is a link, it will call whatever file the href element points too. Its your logic that makes little sense.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.