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
https://forums.phpfreaks.com/topic/65172-if-in-directory/
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
https://forums.phpfreaks.com/topic/65172-if-in-directory/#findComment-325403
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
https://forums.phpfreaks.com/topic/65172-if-in-directory/#findComment-325413
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
https://forums.phpfreaks.com/topic/65172-if-in-directory/#findComment-325419
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.