0

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.

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

<a href="#" onClick="popup('popUpDiv')">Register</a>

But I need to call this in a php script.

Any Help is appreciated.

This is from the php script.

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

}

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

<a href="#" onClick="popup('popUpDiv')">Register</a>
2
  • show us the relevant part of the code Commented Jun 10, 2011 at 21:37
  • show us some code or it didn't happened. Commented Jun 10, 2011 at 21:38

3 Answers 3

1

I think what you want to use if you are looking to do it in php is this ...

header('location: http://yoururl.com/page.php')

Sorry if I don't understand the question completely. Posting some code would help.

Hope this helps :)

Sign up to request clarification or add additional context in comments.

Comments

0

Simply do a server-side check around the HTML you want to output. PHP is parser based.

Comments

0

Try something like this :

<?php
if ($ID = '') {
echo "<script language=javascript>alert('Please enter a valid username.')</script>";
}
?>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.