PDA

View Full Version : PHP- Echo Forum Username on my Home Page (not in forum)


casbboy
03-17-2006, 05:33 PM
I have vbulleting installed in my /forums/ directory.

When I put a file with this coding in it, it will echo my username used on my site's vbulletin:


require_once($_SERVER['DOCUMENT_ROOT'] .'/forums/global.php');
echo $vbulletin->userinfo['username'];


I upload this file to my /forums/ folder and it works great.

However, when I used this same script on my index page (home page) it doesn't work at all and stops the page from loading right where the script is placed.

I want my homepage to look for the existance of a 'username' and, if it finds one, say something like "Welcome back Username" to the right of my homepage. If not, it will say "Log in/Register"

I see a lot of sites that do this and thought it would be easy.

Thanks
Ryan

tehste
03-17-2006, 05:39 PM
firstly:

wrong forum.

secondly:

www.vbadvanced.com

Snake
03-18-2006, 11:49 AM
Ding ding ding!