PDA

View Full Version : (vB2) Calling User info in form


Veg
01-15-2004, 07:50 AM
Hi,

I was wondering if anyone can help me out with a small problem. I want to know how to call, lets say $bbuserinfo[username], and make it a form variable.

Not sure if you can understand that but let me try and explain it more clearly.

I want a form which inserts into a 'table' the users forum username. Here is what i came up with.



<?php

include ('global.php');

global $bbuserinfo:

echo "<form method='post' action='page.php'>";

echo "<input type='hidden' name='username' value='{$bbuserinfo['username']}'>";

echo "<input type='submit' name='submit'>";

echo "</form>";

?>

And of course i have included the function to add it to the database.

But it gives me a parse error because of {$bbuserinfo['username']}.

Can anyone help?

all-the-vb
01-15-2004, 08:05 PM
$bbuserinfo['username']


change to:


$bbuserinfo[username]



and


global $bbuserinfo:


change to

global $bbuserinfo;


you can delete this line
global $bbuserinfo;

because you not need it

:ermm: sorry for my english.