Display different page content to anonymous and authenticated users

< ?php
/**
* The following simple snippet
* displays different information to anonymous/logged in users within a page.
*
* This works with drupal 4.5 and drupal 4.6
*/
global $user;
if (
$user->uid) {
return
“This message is only visible for logged-in users.”;
}
if (!
$user->uid) {
return
“This message is only visible for not-logged-in users.”;
}
?>

Leave a Reply

Your email address will not be published. Required fields are marked *