Drupal SignIn/Welcome


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <ul id="access">
  2.  
  3. <li><?php
  4. global $user;
  5. if($user->uid>0){
  6. //logged in
  7. echo "<span>Welcome! $user->name </span>" .l("My Account",'user') .'</li>';
  8.  
  9. }
  10. else {
  11.  
  12. echo l('Sign up','user/register') .'</li>';
  13.  
  14. echo '<li>' .l('Login','user') .'</li>';
  15. }
  16.  
  17. ?>
  18.  
  19. </ul>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.