Проблемы с регестрацией!
<?php
$L2EMUBS_config["mysql_host"]="78.х.х.х"; // MySQL IP
$L2EMUBS_config["mysql_port"]="3306"; // MySQP port
$L2EMUBS_config["mysql_db"]="l2emu_db"; // Emu_DB or your lineage 2 server database name
$L2EMUBS_config["mysql_login"]="root"; // MySQL Login name
$L2EMUBS_config["mysql_password"]="х"; // MySQL Password
error_reporting(0);
?>
<?php
$L2EMUBS_config["javascript_sort_method"]="bubble";
$link = mysql_connect($L2EMUBS_config['mysql_host'].":".$L2EMUBS_config['mysql_port'], $L2EMUBS_config['mysql_login'], $L2EMUBS_config['mysql_password']);
if (!$link)
die("Couldn't connect to MySQL");
@mysql_select_db($L2EMUBS_config['mysql_db'], $link)
or die ('Error '.mysql_errno().': '.mysql_error());
?>
<H4>Registration</h4>
<script type="text/javascript">//<![CDATA[
function isAlphaNumeric(value)
{
if (value.match(/^[a-zA-Z0-9]+$/))
return true;
else
return false;
}
function checkform(f)
{
if (f.account.value=="")
{
alert("Fill in all fields Please");
return false;
}
if (!isAlphaNumeric(f.account.value))
{
alert("Fill in all fields");
return false;
}
if (f.password.value=="")
{
alert("No password ");
return false;
}
if (!isAlphaNumeric(f.password.value))
{
alert("444444");
return false;
}
if (f.password2.value=="")
{
alert("You didnt repeat a password");
return false;
}
if (f.password.value!=f.password2.value)
{
alert("Not the same password ");
return false;
}
return true;
}
//]]></script>
<form method="post" action="?ir=reg" onsubmit="return checkform(this)">
<table>
<tr>
<td><b><font face="Trebuchet MS" size="1">Login</font></b></td>
<td><font face="Trebuchet MS" size="1"><b>
<input type="text" name="account" maxlength="15" size="20" /></b></font></td>
</tr>
<tr>
<td><b><font face="Trebuchet MS" size="1">Password</font></b></td>
<td><font face="Trebuchet MS" size="1"><b>
<input type="password" name="password" maxlength="15" size="20" /></b></font></td>
</tr>
<tr>
<td><b><font face="Trebuchet MS" size="1">Repeat Password</font></b></td>
<td><font face="Trebuchet MS" size="1"><b>
<input type="password" name="password2" maxlength="15" size="20" /></b></font></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<font size="1" face="Trebuchet MS"><b><br />
<input type="submit" name="submit" value="Register" /></b></font></td>
</tr>
</table>
</form>
<?php
if(ereg("^([a-zA-Z0-9_-])*$", $_POST['account']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['password']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['password2']))
{
if ($page="index.php" && $_POST['account'] && strlen($_POST['account'])<16 && strlen($_POST['account'])>3 && $_POST['password'] && $_POST['password2'] && $_POST['password']==$_POST['password2'])
{
$check=mysql_query("select * from accounts where login='".$_POST['account']."'");
$check1=mysql_num_rows($check);
if($check1>0)
{
echo "<p clss='error'><b>Failed to register : an account already excist .</b></p>";
}
else
{
mysql_query("INSERT INTO accounts (login, password, access_level) VALUES ('".$_POST['account']."', '".base64_encode(pack('H*', sha1($_POST['password'])))."', 0)", $link);
mysql_close($link);
print '<p class="error"><b>Registration over successful </b></p>';
}
}
else
{
print '<p class="error"><b> </b></p>'.mysql_error();
}
}
else
{
echo "Restrictions have not been tested for safety. Please try to sign up with another username and password.";
}
?>
Суть проблемы в том что пишет рег прошел , а в базу не добавилось записи!
Хотя если в ручную создать запись то пишет что имя уже занито?
Зарание спасибо!!!!!!
замени на

