here, try putting this file inside the forums directory that your vbull is in. Let me know if it runs without error. call it something like test.php
---------------
<?php
error_reporting(0);
require("global.php");
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
mysql_select_db("$DBName") or die("Unable to access the News");
$namequery = "SELECT username FROM user WHERE userid = $bbuserid";
$namegrab = mysql_query($namequery);
$name = mysql_result($namegrab,"username");
if ($bbuserid != 0)
{ print "Welcome back, <b>$name</b>"; }
else
{ print "Welcome <b>guest</b>"; }
?>
---------------
If it works the solution should be fairly easy but will require a seperate file... I'll get on that as soon as you can tell me if it functions.
|