Forums

Form behind a login

marcoarens 02 Feb, 2010
How do I place a form direct behind a login?

A menuItem point to the Form behind a login....

Thanks,
Marco
GreyHead 02 Feb, 2010
Hi marcoarens,

Check the user id at the beginning of the form html and redirect if they aren't logged in.
<?php
if ( !$mainframe->isSite() ) { return; }
$user =& JFactory::getUser();
if ( !$user->id ) {
  $mainframe->redirect('index.php');
}
?>

Bob
marcoarens 02 Feb, 2010
Thanks for your reply.

It works, but not as I want.

First the visitor, clicks on a menuitem.
The visitor comes on a login page.
After login the visitor goes directly to the form.

Marco
GreyHead 02 Feb, 2010
Hi Marco,

Sorry, I misunderstood. Can you use the Login module redirection page?

Bob
marcoarens 02 Feb, 2010
Hi Bob,

From the loginmodule I can only redirect to a menuitem/page, not directly to a Form...

Is there a way to fix that?

Thanks,
Marco
GreyHead 02 Feb, 2010
Hi Marco,

Add the Form to a menu - you can make it a hidden menu if you don't want to display the link.

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