salted md5 password generated with spring different from salt md5 password generated in php
<p>I am using username as a salt for spring security however when I tried to do the similar case in php it generates a different hashed password.  The following is my php code:</p>

<pre><code>&lt;?php
   $un=$_POST['username'];  
   $pw=$_POST['password']; 
   $salt ='weiren';
   $passw='enjoyit';
   $pass=md5($passw.md5($salt));
   mysql_connect("localhost","root","");
   mysql_select_db("dbname");
   $sql=mysql_query("select * from people where username = '$un' and password = '$pw'");

   if(mysql_num_rows($sql) &gt; 0)  
      // ( $un == “ajay” &amp;&amp; $pw == “ajay”)  
      echo 1;  // for correct login response  
   else  
      echo $pass;
   // for incorrect login response  
?&gt;
</code></pre>
