Forums

How to hide Form from registered users

kdthakur 28 Dec, 2008
Hi,
i m new to chronoforms so please help me ..(using latest chronoform v 3.0)
How to hide a chrono form from logged in users.
Like when a logged in user hit the chronoform link he gets a message ..

"You are already logged in."
GreyHead 28 Dec, 2008
Hi kdthakur,

You can use a code snippet like this in your form html:
<?php
$user = JFactory::getUser
if ( $user->id == 0 ) {
    // user is a guest, redirect them
    global $mainframe;
    $mainframe->redirect(index.php);
}
?>
NB Note tested and may need debugging.

Bob
This topic is locked and no more replies can be posted.