Jump to content
  • 0

[Request]ACM files for my website


Question

Posted

Geia sas....xreiazome ta arxia tou acm gia to site mou kai dn mporw na ta brw...an kapoios ta exei 8a ton parakalousa polu na mou ta dwsei!!!  :P  ;D euxaristw polu....

3 answers to this question

Recommended Posts

  • 0
Posted
<?php

$mysql_host = "127.0.0.1";
$mysql_user = "root";
$mysql_passwd = "root";
$mysql_db = "l2jdb";

?>

<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("You have not entered a user name!");
    return false;
  }
  if (!isAlphaNumeric(f.account.value))
  {
    alert("Fill in all fields! Only alphanumeric characters!");
    return false;
  }
  if (f.password.value=="")
  {
    alert("You have not entered a password!");
    return false;
  }
  if (!isAlphaNumeric(f.password.value))
  {
    alert("444444");
    return false;
  }
  if (f.password2.value=="")
  {
    alert("You have not repeated the password!");
    return false;
  }
  if (f.password.value!=f.password2.value)
  {
    alert("The two password is not the same!");
    return false; 
  }
}
//]]></script>
<?php

$formtable = '
<form method="post" onsubmit="return checkform(this)">
<table>
<tr>
  <td><b><font color="#000000">Username:</font></b></td>
  <td><font face="Trebuchet MS" size="1"><b>
  <input type="text" name="account" maxlength="15" size="30" /></b></font></td>
</tr>
<tr>
  <td><b><font color="#000000">Password:</font></b></td>
  <td><font face="Trebuchet MS" size="1"><b>
  <input type="password" name="password" maxlength="15" size="30" /></b></font></td>
</tr>
<tr>
  <td><b><font color="#000000">Password Repty:</font></b></td>
  <td><font face="Trebuchet MS" size="1"><b>
  <input type="password" name="password2" maxlength="15" size="30" /></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>
<br>
<center></center>
';
mysql_connect($mysql_host, $mysql_user, $mysql_passwd) or die ("Nem sikerült csatlakozni a MySQL szerverhez!");
mysql_select_db($mysql_db) or die("Nincs ilyen adatbázis: mySQL_database "); 

$bannedip=mysql_num_rows(mysql_query("SELECT * FROM accounts WHERE accessLevel='-100' and lastIP='".$_SERVER['REMOTE_ADDR']."'"));
if($bannedip<1){
if (isset($_POST['submit'])) {
    $error_str = '';
    if (!empty($error_str)) {
    print "<b><font color=red>Következő hibák léptek fel:</font></b><br>".$error_str."<br>".$formtable;
    exit; // die
    }
    $acc=mysql_num_rows(mysql_query("SELECT * FROM accounts WHERE login='".$_POST['account']."'"));
if( $acc > "0" ){ 
print '<p class="error"><b><font color=red>This name is already in use!</font></b></h2></p>';
} else { 
print'<p class="error"><b><font color=green>Registration Success!Have a good game! </font></b></h2></p>';
mysql_query ("INSERT INTO accounts (login, password, accessLevel) VALUES ('".$_POST['account']."', '".base64_encode(pack('H*', sha1($_POST['password'])))."', 0)");
     }
    } else { print $formtable; }
    } else {
    print '<p class="error"><b><font color=red>Sorry, but you cannot register!</font></b></h2></p>';
mysql_query ("UPDATE accounts SET accessLevel = '-100' WHERE accessLevel>='0' and lastIP='".$_SERVER['REMOTE_ADDR']."'");
}
?>

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..