MyBB Community Forums

Full Version: Modifcation of SQL insert file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

What file/where is the file that is inserting users into mybb_users table?
The one that is used during installation is /install/resources/mysql_db_inserts.php
When I navigate to the registration page, I right click and select 'View Source'. The ucp.php?mode=register file shows up. I would imagine that this is the file where I put the code that I wrote.

I wrote some code that inserts a username and password into my database running on the same host. The code is as follows:

<?php

	$db_hostname = "localhost";
	$db_username = "myusername";
	$db_password = "mypassword";
	$db_name	= "mydb";
	

	$dbh = mysql_connect($db_hostname, $db_username, $db_password) or die("Error: " . mysql_error());
	

	mysql_select_db($db_name);


	$username = "$_POST[username]";
	$password = "$_POST[password]";

	
	$result = mysql_query("INSERT INTO users (name, pword) VALUES ('$username', '$password')");
	
	if ($result)
	{
		echo "<h1> Registered Credentials </h1>";
	}	
	else
	{
		echo "<h1> Error Registering </h1>";
	}
?>


Any idea where to put it?