Forums

Redirect to form based on password

vasterman 26 Jan, 2013
I have a simple password box for authentication and would like to know if it's possible to redirect a user to a form based on the passwords.

Example:

if passwordx -> form1
if passwordy -> form2
if passwordz -> form3
etc etc.

So depending on the password the user will be shown a form.

i have it working with 1 password to 1 form based on help from the forum:
<?php
$password =& $form->data['password'];
if ( !isset($password) || !$password || $password != '12345' ) {
$form->validation_errors['password'] = 'Please enter a valid password';
return false;
}
?>

thank you Basv
GreyHead 28 Jan, 2013
Hi vasterman,

My Event Switcher [GH] action is probably the simplest way. You can use Show Form actions in the Events to redirect to other forms.

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