update i tryed the following:
Code:
<?php
include('md5.php');
// Skin Settings
$title = $name." ".$lang[15];
// Registration Start
if ($_GET['do'] == 'createaccount') {
if ($_SESSION['registerOk'] != "canRegister") {
echo "<script>self.location = 'index.php?act=registration'</script>";
} else {
$_SESSION['registerOk'] = "";
}
error_reporting(E_ALL ^ E_NOTICE);
$login = trim($_POST['user']);
$pw = trim($_POST['pw']);
$id = trim($_POST['id']);
$c_pw = trim($_POST['c_pw']);
$c_id = trim($_POST['c_id']);
$pwh = passConvert($pw);
$pwhc = passConvert($c_pw);
$login = test($login);
$pw = test($pw);
$id = test($id);
$c_pw = test($c_pw);
$c_id = test($c_id);
if ($pw != $c_pw && $id != $c_id) {
parth1tr();
parth1(560,4,1);
echo $lang[15];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo $lang[20] . "<br><a href='$PHP_SELF?act=registration'>Register Again</a>";
part2();
part2tr();
die();
}
if ($pw != $c_pw) {
parth1tr();
parth1(560,4,1);
echo $lang[21];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo $lang[20] . "<br><a href='$PHP_SELF?act=registration'>Register Again</a>";
part2();
part2tr();
die();
}
if ($id != $c_id) {
parth1tr();
parth1(560,4,1);
echo $lang[22];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo $lang[20] . "<br><a href='$PHP_SELF?act=registration'>Register Again</a>";
part2();
part2tr();
die();
}
if (!empty($pw) && strlen($pw) < 4) {
parth1tr();
parth1(560,4,1);
echo $lang[23];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo $lang[20] . "<br><a href='$PHP_SELF?act=registration'>Register Again</a>";
part2();
part2tr();
die();
}
if (!empty($id) && !ereg("[0-9]", $id)) {
parth1tr();
parth1(560,4,1);
echo $lang[24];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo $lang[20] . "<br><a href='$PHP_SELF?act=registration'>Register Again</a>";
part2();
part2tr();
die();
}
if (!empty($id) && strlen($id) < 4) {
parth1tr();
parth1(560,4,1);
echo $lang[25];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo $lang[20] . "<br><a href='$PHP_SELF?act=registration'>Register Again</a>";
part2();
part2tr();
die();
}
if (empty($login) || empty($pw) || empty($id) || empty($c_pw) || empty($c_id)) {
die($lang[26]);
}
if (!empty($login) && !empty($pw) && !empty($id) && !empty($c_pw) && !empty($c_id)) {
$msconnect=odbc_connect("$dbname","$dbuser","$dbpass");
$msteste="SELECT COUNT(strACcountID) FROM tb_user WHERE strAccountID = '$login'";
$msresul=odbc_exec($msconnect,$msteste) or die($lang[27]);
odbc_fetch_row($msresul);
if (odbc_result($msresul,1) > 0) {
parth1tr();
parth1(560,4,1);
echo $lang[15];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo "This Account in using try other.<br><a href='$PHP_SELF?act=registration'>Register Again</a><table height='328'><tr><td height='328'> </td></tr></table>";
part2();
part2tr();
} else {
$msquery="INSERT INTO tb_user(strACcountID, strPasswd, strSocNo, idays) VALUES ('$login','$pwh','$id','6') ";
$msresults=odbc_exec($msconnect,$msquery) or die($lang[27]);
parth1tr();
parth1(560,4,1);
echo $lang[15];
parth2();
parth2tr();
part1tr();
part1(560,4,1,1);
echo $lang[28]."<p>".$lang[1].": ".$login."<br>".$lang[16].": ".$pw."<br>".$lang[18].": ".$id;
part2();
part2tr();
}
}
} else {
$_SESSION['registerOk'] = "canRegister";
$register = '<center><FORM method=post name=regform action=index.php?act=registration&do=createaccount>
<table width="350">
<tr>
<td>
<center></center></td>
</tr>
<tr></tr>
<tr>
<td align="right">'.$lang[1].': </td>
<td width="200"><input type="text" class="input" name="user" value="" maxlength="12" size="10"></td>
<tr><td> </td><td></td></tr>
<tr>
<td align="right">'.$lang[16].': </td>
<td><input type="password" class="input" name="pw" value="" maxlength="12" size="10"></td>
</tr>
<tr>
<td align="right">'.$lang[17].' '.$lang[16].': </td>
<td><input type="password" class="input" name="c_pw" value="" maxlength="12" size="10"></td>
</tr>
<tr><td> </td><td></td></tr>
<tr>
<td align="right">ID:</td>
<td><input type="password" class="input" name="id" value="" maxlength="4" size="10"></td>
</tr>
<tr>
<td align="right">'.$lang[17].' ID:</td>
<td><input type="password" class="input" name="c_id" value="" maxlength="4" size="10"> </td>
</tr>
</table>
<input class="input" type="submit" value="Register">
</form>
</center>';
parth1tr();
parth1('25%', 1, 1);
echo $lang[15];
parth2();
parth2tr();
part1tr();
part1('25%', 1, 1, 'left');
echo $register;
echo '<table height="328"><tr><td height="328"> </td></tr></table>';
part2();
part2tr();
}
?> md5.php
Code:
<?php
function passConvert($password)
{
$encar = array('!'=>'95', '"'=>'88', '#'=>'9D', '$'=>'4C', '%'=>'F2', '&'=>'3E', '\''=>'BB', '('=>'C0', ')'=>'7F', '*'=>'18', '+'=>'70', ','=>'A6', '-'=>'E2', '.'=>'EC', '/'=>'77',
'0'=>'2C', '1'=>'3A', '2'=>'4A', '3'=>'91', '4'=>'5D', '5'=>'7A', '6'=>'29', '7'=>'BC', '8'=>'6E', '9'=>'D4', ':'=>'40', ';'=>'17', '<'=>'2E', '='=>'CB', '>'=>'72', '?'=>'9C',
'@'=>'A1', 'A'=>'FF', 'B'=>'F3', 'C'=>'F8', 'D'=>'9B', 'E'=>'50', 'F'=>'51', 'G'=>'6D', 'H'=>'E9', 'I'=>'9A', 'J'=>'B8', 'K'=>'84', 'L'=>'A8', 'M'=>'14', 'N'=>'38', 'O'=>'CE',
'P'=>'92', 'Q'=>'5C', 'R'=>'F5', 'S'=>'EE', 'T'=>'B3', 'U'=>'89', 'V'=>'7B', 'W'=>'A2', 'X'=>'AD', 'Y'=>'71', 'Z'=>'E3', '['=>'D5', '\\'=>'BF', ']'=>'53', '^'=>'28', '_'=>'44',
'`'=>'33', 'a'=>'48', 'b'=>'DB', 'c'=>'FC', 'd'=>'09', 'e'=>'1F', 'f'=>'94', 'g'=>'12', 'h'=>'73', 'i'=>'37', 'j'=>'82', 'k'=>'81', 'l'=>'39', 'm'=>'C2', 'n'=>'8D', 'o'=>'7D',
'p'=>'08', 'q'=>'4F', 'r'=>'B0', 's'=>'FE', 't'=>'79', 'u'=>'0B', 'v'=>'D6', 'w'=>'23', 'x'=>'7C', 'y'=>'4B', 'z'=>'8E', '{'=>'06', '|'=>'5A', '}'=>'CC', '~'=>'62');
$newpass = "0x";
for ($i = 0; $i < strlen($password); $i++)
{
$newpass .= $encar[$password[$i]];
}
return $newpass;
}
?> Code:
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Implicit conversion from data type varchar to varbinary(max) is not allowed. Use the CONVERT function to run this query., SQL state 37000 in SQLExecDirect in E:\AC Web Ultimate Repack\Server\htdocs\registration.php on line 131
Please Choose another Username!