Jump to content


Photo

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


  • Please log in to reply
6 replies to this topic

#1 its99pm

its99pm
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 18 May 2006 - 10:55 AM

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.

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 18 May 2006 - 12:31 PM

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.

Info: PHP Manual


#3 its99pm

its99pm
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 18 May 2006 - 07:39 PM

^ 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?

#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 18 May 2006 - 08:02 PM

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:

$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());
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:
site          phpbb
====          =====
user_id <---> user_id
blah1         username
blah2         user_email 
blah3         user_regdate
.             .
.             . 
.             . 

Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#5 its99pm

its99pm
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 29 May 2006 - 10:11 PM

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.

#6 its99pm

its99pm
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 13 June 2006 - 11:19 AM

:(

#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 13 June 2006 - 11:35 AM

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.


<?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>";}
}

?>


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users