PHP Inside Javascript?
<p>I have the following bit of code:</p>

<pre><code>function deletet(username){
if(confirm("Do you REALLY want to delete your account?")){
    if(confirm("Are you POSITIVE?")){
        var check = prompt("Enter your password","");
        if(check){
            &lt;?php
                require('functions.php');
                mysqlLogin();
                $password = 
                $username = $_COOKIE['sqlusername'];
                $queyreg = ("SELECT * FROM `users` WHERE username='$username'");
                $row = mysql_fetch_array($queryreg,MYSQL_ASSOC);
                $hash = hash('sha256', $row['salt'] . hash('sha256', $password));
                if($hash == $row['password']){
                    $sql = mysql_query("DELETE FROM `users` WHERE username='$username' AND password='$hash'");
                    if($sql){
                        ?&gt; alert("Account deleted, thank you"); window.location='login.php'; &lt;?php
                    } else {
                        ?&gt; alert("There was an error deleting your account"); return false; &lt;?php
                    }
                } else {
                ?&gt; alert("Passwords don't match!"); return false; &lt;?php
                }
            ?&gt;
            return true;
        } else {
            alert("Please enter your password!");
            return false;
        }   
    } else {
        return false;
    }   
} else {
    return false;
}
}
</code></pre>

<p>A few questions.</p>

<ol>
<li>How do I set <code>$password</code> equal to the <code>username</code> variable passed into the function?</li>
<li>Why don't I get the <code>confirm()</code> dialog when I call the function?</li>
</ol>
