05-20-2012, 09:17 PM
Replace: (line 66)
( $conf[use_encryption] ? $pass = md5( $_POST[pass1] ) : $pass = $_POST[pass1] )
To:
( $conf[use_encryption] ? $pass = md5( $_POST[pass1] ) : $pass = $_POST[pass1] );
And...
This (line 100)
colspan="2">
to
Full code:
<?php
// Settings to change
$conf[db][server] = ;
$conf[db][dbase] = ;
$conf[db][user] = ;
$conf[db][pass] = ;
// Set this to true if u want to use encrypted passwords in the database.
// Your Engine.dll must support this in order to set it to true.
// Its highly recommended to use it
$conf[use_encryption] = false;
// Dont change below here unless u know what u are doing -------------------------------------------------------------------
$conf[db][dsn] = sprintf("mysql:host=%s;dbname=%s", $conf[db][server], $conf[db][dbase]);
try
{
$db = new PDO($conf[db][dsn], $conf[db][user], $conf[db][pass]);
}
catch(PDOException $e)
{
die(Error connecting to the database
Registration is not possible at this moment.);
}
if( isset( $_POST[submit] ) )
{
if( strlen( $_POST[username] ) < 3 || strlen( $_POST[username] ) > 15 )
echo Pick a username between 3 and 15 characters long;
elseif( !ctype_alnum( $_POST[username] ) )
echo Please use only alfanumeric characters as username ( a-Z 0-9 );
elseif( strlen( $_POST[pass1] ) < 3 || strlen( $_POST[pass1] ) > 15 )
echo Pick a password between 3 and 15 characters long;
elseif( strcmp( $_POST[pass1] , $_POST[pass2] ) != 0 )
echo Please use 2x exactley the same passwords;
else
{
$dbh = $db->prepare("SELECT count(*) FROM bg_user WHERE user_id = :userid");
$dbh->bindParam(:userid, $_POST[username], PDO:
ARAM_STR);$dbh->execute();
$result = $dbh->fetch();
if( $result[0] != 0 )
echo Username already taken
Please choose another name;
else
{
( $conf[use_encryption] ? $pass = md5( $_POST[pass1] ) : $pass = $_POST[pass1] );
$dbh = $db->prepare("INSERT INTO bg_user (user_id,passwd) VALUES(:userid,:passwd)");
$dbh->bindParam(:userid, $_POST[username], PDO:
ARAM_STR);$dbh->bindParam(:passwd, $pass , PDO:
ARAM_STR);$dbh->execute();
echo Your account is created.;
}
}
}
else
echo
</pre>
<table>UsernamePasswordPassword (again)</table>
<br><br> ;<br><br
now i have other error:
Notice: Undefined index: server in C:\xampp\htdocs\lc\register.php on line 21
Notice: Undefined index: dbase in C:\xampp\htdocs\lc\register.php on line 21
Notice: Undefined index: user in C:\xampp\htdocs\lc\register.php on line 25
Notice: Undefined index: pass in C:\xampp\htdocs\lc\register.php on line 25
Error connecting to the database
Registration is not possible at this moment.
i have my db configuration:
// Settings to change
$conf[db][test] = ;
$conf[db][newproject_db_auth] = ;
$conf[db][root] = ;
$conf[db][test] = ;
