Jump to content

Archived

This topic is now archived and is closed to further replies.

its99pm

How to get a sign up form to create an account in 2 places?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
^ 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?

Share this post


Link to post
Share on other sites
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_id
blah1         username
blah2         user_email
blah3         user_regdate
.             .
.             .
.             .
[/code]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 login

There 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>&nbsp;</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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.