Use a javascript function in php
<p>I have a nav bar on my site that has dynamic links. When the user is logged out, I want these links to say "Register | Log in" and when they are signed in, I want those same links to change to "$userName | Account". I have a script to handle this, but there is one problem. </p>

<p>When the user is signed out, I want the "Register" link to open a popup div with the registration page on it, instead of forwarding them to a different page. The only problem is, the way I am handling this is in a link like </p>

<pre><code>&lt;a href="#" onClick="popup('popUpDiv')"&gt;Register&lt;/a&gt;
</code></pre>

<p>But I need to call this in a php script. </p>

<p>Any Help is appreciated. </p>

<p>This is from the php script. </p>

<pre><code> if (!isset($_COOKIE['idCookie'])) {
 $logOptions = ' &lt;a href="http://' . $dyn_www . '/register.php"&gt;Register&lt;/a&gt;
 &amp;nbsp;&amp;nbsp; | &amp;nbsp;&amp;nbsp; 
 &lt;a href="http://' . $dyn_www . '/login.php"&gt;Log In&lt;/a&gt;';
</code></pre>

<p>}</p>

<p>But instead of having the whole register.php, i just want it to go to</p>

<pre><code>&lt;a href="#" onClick="popup('popUpDiv')"&gt;Register&lt;/a&gt;
</code></pre>
