Making a Link Appear if a Condition is Met
<p>The PHP code below echoes a link if the "loginid" of the logged-in user is on a list determined by getEditorList();.  It works fairly well, but I think it might work better if I were to do it with Javascript instead.  </p>

<p>How could I accomplish the same thing with Javascript?</p>

<p>Thanks in advance,</p>

<p>John</p>

<pre><code>$editors = getEditorsList();
            foreach($editors as $editor)
            {
            $editorids[] = $editor['loginid'];
            }

            if(in_array($_SESSION['loginid'], $editorids))
            {
            echo "&lt;div class='footervote'&gt;&lt;a href='http://www...com/.../footervote.php'&gt;Vote&lt;/a&gt;&lt;/div&gt;";
            } 
</code></pre>

<p>Login function:</p>

<pre><code>&lt;?php
if (!isLoggedIn())
{

    if (isset($_POST['cmdlogin']))
    {

        if (checkLogin($_POST['username'], $_POST['password']))
        {
            show_userbox();


        } else
        {
            echo "Incorrect Login information !";
            show_loginform();
        }
    } else
    {

        show_loginform();
    }

} else
{

    show_userbox();

}



?&gt;
</code></pre>
