MyBB Community Forums

Full Version: New field on register page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.
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/
(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?
^ yes, custom profile fields are stored in the database. fields are stored in mybb_profilefields & values are in mybb_userfields