Location: PHPKode > projects > Mirroring Boards > add_user.php
<?

if (isset ($_POST['add']))
 {
mysql_connect ("localhost", "www.beng", "2pebv8mn");
mysql_select_db ("www_beng");

/*
** Adding new user :)
*/

    $sql = "INSERT INTO mb_users (login, pass, access) ";
    $sql.= "VALUES ('".$_POST['login']."', '".$_POST['pass']."', '')";
    mysql_query ($sql);

    echo "<a href=list_board.php>See Boards</a><br><br>\n";

  mysql_close();
 }
else
 {
  echo "<table><tr><td align=center>\n";
  echo "<script language=\"JavaScript\" src=\"md5.js\"></script>\n";
  echo "<script language=\"Javascript\">\n";
  echo " function encode()\n";
  echo " { document.add_form.pass.value = hex_md5 (document.add_form.pass.value); }\n</script>\n";
  echo "<form name=add_form action=add_user.php method=post>\n";
  echo "<input type=hidden name=add value=true>\n";
  echo "<input type=text name=login value=nickname size=20 maxlenght=15><br>\n";
  echo "<input type=password name=pass value=password size=20><br>\n";
  echo "<input type=submit value=register onclick=\"encode();\">\n";
  echo "</table><br><br>\n";
 }

include ("md5_info.php");

?>
Return current item: Mirroring Boards