Log in

View Full Version : if/else anywhere


rcull
11-11-2008, 03:19 PM
I have been messing with an if/else statement.

I have made a .php with:

<?php
require("http://www.teambuick.com/forums/global.php");
?>

and am trying to make something like this work:

<?php
if condition="is_member_of($bbuserinfo,5,6,7,9,10,13)" {
?>
This is for a member<br>
<?php
} else {
?>
This is for a guest<br>
<?php
}
?>

I would like it to function in any directory on my site. Is it easy and am I just missing something simple?

Thanks!

Dismounted
11-12-2008, 07:23 AM
You should never include files using a URL - they simple won't work.
$cwd = getcwd();
chdir('/path/to/your/forum');
require_once('./global.php');
chdir($cwd);
All you need to change is "/path/to/your/forum".