PDA

View Full Version : registration.php


wizardsolutions
03-13-2007, 11:56 PM
Instead of merging two databases, I'm going to have one signup page (the vbulletin register.php) and insert into the other database from there.

Right now I have my insert code under the following code at the end:

// ############################### start add member ###############################
if ($_POST['do'] == 'addmember')
{
It seems to be working for the most part, but I can't seem to get the password and email. I thought I could use the following, but it's not working. The username is fine.


$emailid = $vbulletin->GPC['email'];
$userpwd = $vbulletin->GPC['password'];
$username = $vbulletin->GPC['username'];

Another problem: Where should I put my extra database code so that it only gets submitted when the initial form information is inputed correctly?


Thanks.

*bump

I've tried everything and cannot get the password of the user currently signing up. I see $vbulletin->GPC['password'] being used by vbulletin, but why is it not working for me?

Flexserve
03-18-2007, 08:11 PM
looking for this too.

TheRed
03-19-2007, 01:58 AM
Try using $userdata->vars['password'].

But your code must be located below:



$vbulletin->userinfo['userid']
= $userid
= $userdata->save();


Anyways he got sorted this out already.

Flexserve
03-19-2007, 02:46 AM
Try using $userdata->vars['password'].

But your code must be located below:



$vbulletin->userinfo['userid']
= $userid
= $userdata->save();


Anyways he got sorted this out already.

I'm trying to send to this:
// SQL data
$db_u = "root"; // fill in ur db username
$db_p = "***"; // fill in ur db pass
$db_host = "********"; // fill in only if u're not running it on the same machine as the db.

// don't change
$u = $_POST['user'];
$p = $_POST['pass'];
$e = $_POST['email'];


//Database Link
@$link = mysql_connect("$db_host", "$db_u", "$db_p");
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('v3');
$q = "insert into `accounts` (login,password,s,v,gm,sessionkey,email) values
('$u','$p','NULL','NULL','0','NULL','$e')";

}
?>
Just need login, pass, e-mail..the rest is defualt values. Please help this php noob out.