PDA

View Full Version : PHP Question


Indy
07-15-2002, 11:50 PM
I'm working with including the global.php file for writting a stand alone program that uses the vB security system. On my machine at home, (W2K Pro), I have the latest and greatest PHP, mySQL, Apache and Perl installed. System works great and I can easily develop code without the hassles of uploading and testing online. However, I have run into one little problem that I can't figure out.

Here is the code that works on the real time server:

<?php

require("global.php");

if ($bbuserinfo['userid']==0) {
echo"You need to log in!";
}
else {
$username=$bbuserinfo['username'];
echo "USERNAME: $username";
}
?>

The error I receive when running this program on my local machine is:

Warning: Cannot add header information - headers already sent by (output started at C:\My Webs\vbulletin\test.php:2) in C:\My Webs\vbulletin\admin\functions.php on line 1579
USERNAME: admin

I'm assuming that something may not be setup correctly in PHP, Apache or something else. I appreciate any feedback you can give. I program, but I have only installed PHP, mySQL, etc. on my local machine about 2 months ago and I'm not that all familiar with tweaking it. Everything else that I have written locally works great. My test vB works great locally as well.

Thanks all!

ps: Love the :banana:

Neo
07-16-2002, 01:28 AM
Now where did you put this code?

Indy
07-16-2002, 03:24 PM
The above listed code is a test program, test.php which I have in the forums root dir for the moment. I'm just testing the use of the vB security system. I'll eventually be incorporating the code in my files which will eventually be in another dir.

The test program works great on both my local machine and on the real time server. It's just that I get the header warning message when running on my local machine.