Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 11 Months, 3 Weeks ago New field on register page
#1
Solved: 3 Years, 11 Months, 3 Weeks ago
So I am setting up a forum for a garrysmod server and I am trying to make it so when a person signs up on the forum and enters their steam id it is saved in a database then read by the server. Here is where they enter the information on the register page
[Image: 8sl12aS.jpg?2]
Here is the code I added to make it

<tr>
	<td width="50%" valign="top"> <span class="smalltext"><label for="steamid">SteamID:   (Use <a href="http://steamidfinder.com/">SteamID Finder</a> to find your SteamID)</label> </td>
</tr>
<tr>
<td width="50%" valign="top"><input type="text" class="textbox" name="steamid" id="steamid" style="width: 100%" maxlength="100" value="{$steamid}" />
</td>
</tr>


Here is the code I have to insert the information into the database, db.php is where the database information is stored.

	include_once('db.php');
	mysql_query("INSERT INTO `steamid` (`steamid`) VALUES ('$steamid')");


The problem is I don't know where to put the php code, when I put it in member.php it would either store the steam id correctly, but not create the profile on the forum, or create the profile on the forum and inserts a blank space in the database. Is it because I need to put the code somewhere else or the code is wrong?

Basically I need to make user input on the register page save to a database.
Reply
#2
Solved: 3 Years, 11 Months, 3 Weeks ago
in general we use custom profile fields for such purpose
admin panel >> configuration >> Custom Profile Fields

related guidance => http://docs.mybb.com/1.6/Admin-CP-Config...le-Fields/
Reply
#3
Solved: 3 Years, 11 Months, 3 Weeks ago
(07-24-2015, 05:35 AM).m. Wrote: in general we use custom profile fields for such purpose
admin panel >> configuration >> Custom Profile Fields

related guidance => http://docs.mybb.com/1.6/Admin-CP-Config...le-Fields/
Thanks, I never saw that. So this will store the information in the database correct? And if so what table name would it be under?
Reply
#4
Solved: 3 Years, 11 Months, 3 Weeks ago
^ yes, custom profile fields are stored in the database. fields are stored in mybb_profilefields & values are in mybb_userfields
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)