Echoing Javascript not alerting
<p>I have the following php code:</p>

<pre><code>&lt;?php
if (isset($_POST['submitLogin'])) {
    $password = $_POST['password'] ;
    $username = $_POST['username'];
    if (invalidChars($username, $password) &gt; 0){
        echo '&lt;script type="text/javascript"&gt;'
                , 'alert(fejl);'
                        , '&lt;/script&gt;';

    }
}


function invalidChars($user, $password){
    $invalidPattern = "/[^A-Za-z0-9]/";

    return preg_match($invalidPattern, $user) + preg_match($invalidPattern, $password);
}
?&gt;
</code></pre>

<p>However when then function invalidChars > 0 no alert is displayed.</p>

<p>Can anyone tell me what I'm doing wrong? im rather new to web development</p>
