Random Password in PHP


SUBMITTED BY: Guest

DATE: June 11, 2013, 9:30 p.m.

FORMAT: PHP

SIZE: 292 Bytes

HITS: 1168

  1. <?php
  2. require_once "database_connections.php";
  3. $uniq = uniqid();
  4. $pass = substr(md5($uniq), 0, 10);
  5. $username = mysql_real_escape_string($_POST["username"]);
  6. mysql_query("INSERT into TABLE (username, password) values ('$username', md5('$pass'))");
  7. ?>

comments powered by Disqus