title: Comparing passwords in php and sending it to a database
body: <p>I am making a login in page and i am a beginner programmer i need to know what function to compare the passwords with then if they do not match tell the user that they dont match and then i need to encrypt them to be sent to the database </p>
  
  <p>Thank you</p>
  
  <p>This is what i have so far:</p>
  
  <pre><code>&lt;?php
  
  $Firstname = $_POST['Firstname'];
  $Lastname = $_POST['Lastname'];
  $Email = $_POST['Email'];
  $password = $_POST['password'];
  $password2 = $_POST['password2'];
  
  if ($&amp;&amp;$password&amp;&amp;$Email&amp;&amp;$Firstname&amp;&amp;$Lastname)
  {
  
  if int strcmp ( string $password , string $password2 )
  {
  
  $connect = mysql_connect("localhost","root","power1") or die("couldn't connect!");
  mysql_select_db("members") or die ("couldnt find db!");
  
  INSERT INTO users (Firstname, Lastname, Email, password,...)
  VALUES ($Firstname, $Lastname, $Email, $password, $password2,...)
  
  }
  else
      die("Your Passswords do not match") 
  
  }
  else
      die("Please enter your credentials");
  
  ?&gt;
  </code></pre>