title: I want to make my password to contain lowercase, uppercase, 8 characters and a character
body: <p>I want to make my password to contain lowercase, uppercase, 8 characters and a character.
  Here is my code:</p>
  
  <pre><code>&lt;?php
  define('DB_NAME', 'baza');
  define('DB_USER', 'root');
  define('DB_PASSWORD', '');
  define('DB_HOST', 'localhost');
  $link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
  if (!$link) {
      die('Could not connect: ' . mysql_error());
  }
  $db_selected = mysql_select_db(DB_NAME, $link);
  if (!$db_selected) {
      die('Can\'t use ' . DB_NAME . ': ' . mysql_error());
  }
  echo 'Your account has been created succesfully! &lt;a href="login.html"&gt; Click here &lt;/a&gt; to login.';
  $value  = $_POST['name'];
  $value2 = $_POST['surename'];
  $value3 = $_POST['genre'];
  $value4 = $_POST['numrikarteles'];
  $value5 = $_POST['email'];
  $value6 = $_POST['username'];
  $value7 = $_POST['password'];
  if (!preg_match('/[^A-Za-z0-9]+/', $value7) || strlen($value7) &lt; 8) {
      echo "Invalid password!";
  } //- kushti per ta kontrollu passwordin 
  $sql = "INSERT INTO user (name, surename, genre, numrikarteles, email, username,password) VALUES ('$value', '$value2', '$value3', '$value4', '$value5', '$value6', '$value7')";
  if (!mysql_query($sql)) {
      die('Error: ' . mysql_error());
  }
  mysql_close();
  ?&gt;
  </code></pre>