Log in

View Full Version : Showing details OUTSIDE forum dir


Teenfrontcouk
03-23-2005, 04:45 PM
Hi, i tried looking around these boards, but see no set tutorial.

I basically want to show a members username, on a page OUTSIDE the forum dir. so on site.co.uk/index.php i want to show the username. im lost, please help!?

cinq
03-23-2005, 11:30 PM
You will need to chdir('the path to your forum dir') followed by require_once('./global.php').

You can then show the logged in member's username by echo-ing $bbuserinfo[username] somewhere on your page which is outside the forum dir.

Teenfrontcouk
03-25-2005, 11:19 AM
Hey thanks for that info..

I did that yet i got a "cannot send cookies" Header already sent in line 06 of bleh/bleh/bleh.php ..

Confused again lol. any help?

My file structure is this...

public_html/index.php (the file which i wish to place $bbuserinfo[username] )
public_html/inc/header.php (where i placed the chdir and require code, this is INCLUDED in index.php)
public_html/forum/all forum files ( global.php etc)

carnt get it to work.

ok nevermind, i pulled out the header.phpfrom the inc/ dir. and put it in the main public dir.. works fine.

hmm actually.. its not fine... when i logout it says the cannot send cookie error again..

Unable to add cookies, header already sent.
File: /home/teenfron/public_html/header.php
Line: 6

but when im logged in, its fine ... strange lol :) HELP!

Teenfrontcouk
03-28-2005, 07:23 PM
hey, i have actually made a customfile that pulls various things from the users cookie,itworks great from the root dir, but if ihave a page in, say../chat , it doesnt display..