Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

simple login form, redirect not working with submit

2 weeks 16 hours ago #1

  • Birger's Avatar
  • Birger
  • Posts: 73
Hello,

I have build a very simple login form. PHP Code with Submit Button currently looks like this:
define( '_JEXEC', 1 );
define('JPATH_BASE', dirname(__FILE__) );
define( 'DS', DIRECTORY_SEPARATOR );

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );

$app = JFactory::getApplication('site');
$app->initialise();

/* variables */
$username = '[Field ID=1]';
$password = '[Field ID=2]';
$remember = '[Field ID=7]';

try{

$app->login( array('username'=>$username,'password'=>$password) );

} catch (Exception $ex) {

    echo 'Exception: ',  $e->getMessage(), '\n';

}

Is this about right? It does work, but...

I am trying to use the redirect option with submit button, but instead redirecting to A, I get redirected to B.

A.

www.mydomain.de/index.php/de/konto-de

B:

www.mydomain.de/index.php/de/%3C!DOCTYPE...%20%3Ctitle%3EFehler........

I have also tried $app->redirect(JRoute::_('index.php')); with PHP code, but it did not work.

Does anybody have a line of code for the session length ("remember" option).

1 week 4 days ago #2

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 11200
Hello,
Thank you for contacting us

We fixed the script at the form ID 3,
now everything works fine.

Best Regards,
Vyacheslav, Balbooa Support Team

1 week 4 days ago #3

  • Birger's Avatar
  • Birger
  • Posts: 73
Thank you very much. This indeed helped a lot.
It's working :)

1 week 3 days ago #4

  • Vyacheslav's Avatar
  • Vyacheslav
  • Posts: 11200
You are welocme ;)
Powered by Kunena Forum