View Full Version : How do i add this php code to headers

08 Aug 2002, 10:43
How do add this Php code to headers in other to read from a file, thanx in advance

$fp = fopen ("/home/theplacement/public_html/forum/storepl.cpl", "r");
$bytes = 900000;
$buffer = fread($fp, $bytes);
fclose ($fp);
print $buffer;


08 Aug 2002, 11:32
Powerless, please go to this (http://www.vbulletin.com/members/vbulletin.org.php) page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.

08 Aug 2002, 17:08
I recently purchased vB and have the same issue!

I need to have a conditional statement in the header...

<? if ($bbuserinfo[userid]!=0)
?><a href="<? echo $siteRoot; ?>/forums/member.php?action=logout"><B>Logout</B></a><? }
?><a href="<? echo $siteRoot; ?>/login.php"><B>Login</B></a><? }

Help! :)

08 Aug 2002, 17:47
Ok, got it working after a few hours.

Had to do everything in the "PHP Parsed Code", and create a bunch of string variables and write them out to the headers. It doesn't really follow the development style of the site, but I guess it works...

Parsed Code

// **** Lets find out what usergroup this user belongs to... ****
//6 = Admin
//8 = NewsAdmin
//9 = ScriptsAdmin
if ($bbuserinfo[usergroupid] == 6){
$strMenuFile = "adminmenu";
}elseif ($bbuserinfo[usergroupid] == 8){
$strMenuFile = "newsmenu";
}elseif ($bbuserinfo[usergroupid] == 9){
$strMenuFile = "scriptsmenu";
$strMenuFile = "menu";

if ($bbuserinfo[userid]!=0)
$strLoggedInMsg = " You are logged in as $bbuserinfo[username]";
$strLogInOutLink = "/forums/member.php?action=logout";
$strLogInOutText = "<B>Logout</B>";
$strLoggedInMsg = "";
$strLogInOutLink = "/login.php";
$strLogInOutText = "<B>Login</B>";

Header Code


<a href="{siteRoot}$LogInOutLink">$strLogInOutText</a>