its99pm Posted May 18, 2006 Share Posted May 18, 2006 I want to set up a sign up form so that when you register, you get 2 accounts - one for a phpbb and one for a members area of the website. Same username and password. How would I go about doing this?I know of at least one website who has this, where if you sign up you get two accounts, one for a phpbb and the other for the auctions on the same domain. Quote Link to comment https://forums.phpfreaks.com/topic/9913-how-to-get-a-sign-up-form-to-create-an-account-in-2-places/ Share on other sites More sharing options...
ober Posted May 18, 2006 Share Posted May 18, 2006 If you're using the default PHPBB registration process, you'll have to modify their code. Either that, or you could just as easily use the PHPBB users table as the same users table for the main page. Quote Link to comment https://forums.phpfreaks.com/topic/9913-how-to-get-a-sign-up-form-to-create-an-account-in-2-places/#findComment-36864 Share on other sites More sharing options...
its99pm Posted May 18, 2006 Author Share Posted May 18, 2006 ^ The users table for the main page holds a significant amount of other information. It's for a street team with adjoining forum, so the account holds point information, completed missions information, website links, etc. I don't think it would be possible to do it that way for this type of site? Quote Link to comment https://forums.phpfreaks.com/topic/9913-how-to-get-a-sign-up-form-to-create-an-account-in-2-places/#findComment-36983 Share on other sites More sharing options...
.josh Posted May 18, 2006 Share Posted May 18, 2006 i once helped this guy create a register script for his site that automatically registered the user on his phpbb forum as well. phpbb only really needs 4 values to be inserted into their table in order to officially register a user: username, email, password and register date. now, there is probably a more "efficient" way of doing this, but here's what I did:i made a site table with the site specific columns, and then a user_id. i got the user's info from the registration form. Then I inserted their username, password email address and registration time into phpbb's user table:[code]$phpbb = mysql_query("INSERT INTO `phpbb_users` (`username`, `user_email`, `user_password`, `user_regdate`) VALUES ('$username', '$email_address', '$db_password','" . time() . "')") or die (mysql_error());[/code]then I retrieved the phpbb user_id generated from the insertion, and then did another query that inserts the rest of the information into the site table, as well as the user_id. that way the two tables will be linked by the user_id, like so:[code]site phpbb==== =====user_id <---> user_idblah1 usernameblah2 user_email blah3 user_regdate. .. . . . [/code] Quote Link to comment https://forums.phpfreaks.com/topic/9913-how-to-get-a-sign-up-form-to-create-an-account-in-2-places/#findComment-36992 Share on other sites More sharing options...
its99pm Posted May 29, 2006 Author Share Posted May 29, 2006 Sorry for bumping ythis after so long, but me and my friends have tried to figure out how to do this but we're all php-virgins pretty much and are really really lost. Is there any chance you could give me a sort of, step by step guide on how to do it? :/ Sorry for being a pain, we're just really fumbling in the dark here and trying to learn how to work with php. Quote Link to comment https://forums.phpfreaks.com/topic/9913-how-to-get-a-sign-up-form-to-create-an-account-in-2-places/#findComment-40090 Share on other sites More sharing options...
its99pm Posted June 13, 2006 Author Share Posted June 13, 2006 :( Quote Link to comment https://forums.phpfreaks.com/topic/9913-how-to-get-a-sign-up-form-to-create-an-account-in-2-places/#findComment-44960 Share on other sites More sharing options...
redarrow Posted June 13, 2006 Share Posted June 13, 2006 THIS CODE WILL LET USER LOGIN PHPBB FROM THERE OWN LOGINNG SYSTEM.Had 5 min spare.As long as you fill in the whatever what is in your user database for your members and put the link in for the loginThere you go.if your members log into your website with name and password there should be no problam.FILL IN THE WHATEVER OK.[code]<?php<br><table cellpadding=5><tr valign=top class=mes><td align=center><fieldset><legend style="color: #ffffff; font-family: verdana; font-size: 10pt;"> <b>Forum Setup</b> </legend><table width="300" class=mes><tr><td align=center><?if ($mode==''){//// EDIT THIS LINE ////$table_prefix = 'phpbb_'; // your phpBB table_prefix (check your phpBB config.php after installation)////////////////////////$phpBB_table = 'users';$tmp=mysql_query("SELECT * FROM WHATEVER WHERE id='$id'"); while($phpBB=mysql_fetch_array($tmp)) { $phpBB_id = ($phpBB['id']);$phpBB_n = ($phpBB['name']);$phpBB_p = md5($phpBB['password']); // use md5 encryption$phpBB_e = ($phpBB['email']);$phpBB_reg = ($phpBB['regdate']);$sql = "INSERT INTO ".$table_prefix.$phpBB_table." (user_id, username, user_level, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm, user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone, user_dateformat, user_actkey, user_newpasswd, user_notify, user_active) VALUES ( '$phpBB_id', '$phpBB_n', 0, '$phpBB_reg', '$phpBB_p', '$phpBB_e', '', '', '', '', '', '', 0, NULL, '', '', '', 0, 0, 1, 0, 1, 0, 1, 1, NULL, '', '', 0, '', '', '', 0, 1)";mysql_query($sql) or die(mysql_error());}}echo "Your members have been added to your phpBB users table.<br><br>";echo "If you are logged in user<br><a href=phpBB_setup.php?mode=test_login class=menu>click here</a> to test the forum login.";if ($mode!=''){$tmp=mysql_query("SELECT * FROM WHATEVER WHERE id= '$id' LIMIT 1"); while($phpBB=mysql_fetch_array($tmp)) {$phpBB_n = ($phpBB['name']);$phpBB_p = ($phpBB['password']);//// EDIT THIS LINE ////echo "<form action=\"http://WHATEVER.com\" method=\"post\" target=\"_blank\">";////////////////////////echo "<input type=\"hidden\" name=\"username\" size=\"25\" value=\"$phpBB_n\" maxlength=\"40\">";echo "<input type=\"hidden\" name=\"password\" size=\"25\" value=\"$phpBB_p\" maxlength=\"32\">";echo "<input type=\"submit\" name=\"login\" value=\"Test Login\">";echo "</form>";}}?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/9913-how-to-get-a-sign-up-form-to-create-an-account-in-2-places/#findComment-44963 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.