PDA

View Full Version : running script after confirmed


diesel08
04-06-2005, 08:01 AM
in register.php underneath..


if ($userinfo['coppauser'] OR ($vboptions['moderatenewmembers'] AND !$userinfo['posts']))
{
// put user in moderated group
eval(print_standard_error('error_moderateuser'));
}
else
{



i inserted...


// activate account
$username = unhtmlspecialchars($userinfo['username']);

$DB_site->query("INSERT INTO USERS(UserID, Username, Password) VALUES('".$bbuserinfo['userid']."','".$bbuserinfo['username']."','green')");



and underneath that is the normal code...


if ($vboptions['welcomemail'] AND !$userinfo['posts'])
{
eval(fetch_email_phrases('welcomemail'));
vbmail($userinfo['email'], $subject, $message);
}


e.t.c....



Now... as you can tell my statement inserts data to table using sql query..

but the part .$bbuserinfo['username']. seems to be not getting the username every time..


8 out of 10 instances so far it has saved the username 'Unregistered'


to fix this should i put my code in another part of the script, or use a different variable instead of $bbuserinfo['username']


Basically trying to run my code once the user has confirmed registration.. and needs their uid and uname to work.


help appreciated.

sabret00the
04-06-2005, 09:23 AM
what is the script using around that point?

try using an addslashed $_POST['username']

diesel08
04-07-2005, 01:14 AM
i dont understand your question?

when a person confirms their activation, i want that username to be inserted into my sql code that is pasted above.. in some cases it isnt posting the Username that has been confirmed.. and is doing 'Unregistered'

Im puzzled about why it is doing this, and wondered if there is another way to reference the username that is being confirmed.. or if i should place the code somewhere else.