2015-07-24, 05:27 AM
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
Here is the code I added to make it
Here is the code I have to insert the information into the database, db.php is where the database information is stored.
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.
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.