2014-07-01, 01:00 AM
2014-07-01, 01:04 PM
The one that is used during installation is /install/resources/mysql_db_inserts.php
2014-07-02, 12:24 AM
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:
Any idea where to put it?
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?