- Joined
- Jan 29, 2010
Code:
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
$username = $_POST["RGusername"];
$password = md5($_POST["RGpassword"]);
if($username&&$password)
{
mysql_connect('localhost','root','admin');
mysql_select_db("database") or die("Couldn't find database");
$Query = mysql_query("SELECT * FROM account WHERE Username='$username' LIMIT 1");
print"<pre>Query: ".$Query."</pre>";
$result = mysql_query("SELECT * FROM account WHERE Username='$username' LIMIT 1");
print "<pre>Result: ".var_dump($result)."</pre>";
$id = (mysql_insert_id() + 1);
$rows = mysql_num_rows($Query);
echo $rows ;
if($rows == 0)
{
mysql_query("SELECT * FROM account");
mysql_query("INSERT INTO `account` (Username, Password)
VALUES($username, $password)");
echo $password; ?><html> <br /> </html> <?php
echo $rows; ?><html> <br /> </html> <?php
echo $username; ?><html> <br /> </html> <?php
echo $id; ?><html> <br /> </html> <?php
echo mysql_error(); ?><html> <br /> </html> <?php
if(mysql_num_rows($Query) == 1)
{
// Successful account creation
echo("Account created");
}
else
echo("Account not created, problem hit");
}
else
echo("Username already exists");
}
else
echo("Please enter all feilds");
?>
There's the code and what it's doing is inserting the username and password into a database then checking that it's there, can't fix it :3
Last edited: