How to add salt in user password?
<p>I am using simple <code>md5($password);</code> format but i want to add salt so how i can do that?</p>

<p>here is my code :</p>

<pre><code>   if($success)
    {
        $data['firstname'] = $firstname;
        $data['lastname'] = $lastname;
        $data['username'] = $username;
        $data['password'] = md5($password);
        $data['email'] = $email;


        $newUser = new User($data);
        $newUser-&gt;save(true);
        $Newuser-&gt;login($username, $password);
        header("Location: welcome.php");

    }
</code></pre>
