<?php
  ///////////////////////////////////////////////////
  //2007 (C)
  //Карпухин Павел
  ///////////////////////////////////////////////////

  $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0,2);
  if (is_file ("../../lang/".$lang."/".$lang.".php")) include "../../lang/".$lang."/".$lang.".php";
     else include "../../lang/ru/ru.php";

  $title=$titlepage = $TEXT['bllst-ed'];
  $helppage = $TEXT['bllst-ed-tit'];

  require_once "../../config.php";
  require_once "../../util/top_layer2.php";

  if($result2['administrator'] == 0) puterror($TEXT['error-loginform4']);

  if(!isset($button)) $button = $TEXT['btn_edit'];
  if(!isset($action)) $action = "edit.php";

  if(empty($_GET['address'])) puterror($TEXT['bllst-error1']);
  if(strlen($_GET['address'])>65) puterror($TEXT['bllst-error2']);
  $_GET['address'] = str_replace("'","`",$_GET['address']);
  $_GET['address'] = htmlspecialchars(stripslashes($_GET['address']));

  $old_address = $_GET['address'];

  $query = "SELECT * FROM `whitelist` WHERE `address`='".$_GET['address']."' ";
  $result = mysql_query($query);
  if (!$result) puterror($TEXT['error-tbl29']);
      $result2 = mysql_fetch_array($result);
         $address = $result2['address'];
?>
<form enctype='multipart/form-data' action=<?php echo $action; ?> method=post>
<table>
<tr><td class="useraddedit"><?php echo $TEXT['bllst-text2']; ?></td><td class="useraddedit"><input size=50 maxlength=64 class="inputmandatory" type=text name=address value='<?php echo $address; ?>'></td></tr>
<tr><td></td><td>
<input class=button type=submit value='<?php echo $button; ?>' />
<input type=hidden name=old_address value='<?php echo $old_address; ?>' />
</td></tr>
</table>
</form>
<?php
  require_once "../../util/bottom.php";
?>