Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7168227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:44:15+00:00 2026-05-28T14:44:15+00:00

in a module that we want to display as a demo, i wanted to

  • 0

in a module that we want to display as a demo, i wanted to show what a login can look like
so no big need in security mesures.

my problem is the following : when i enter this code, the page goes blank. the frame doesn’t load and looks like joomla don’t get i’m loading a page. (no html)

it is my first time playing with JSession.

defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' );
define("SHAKERCLASS"," jhShake_module");
jimport( 'joomla.application.module.helper' );

$document   = &JFactory::getDocument();
$db         = &JFactory::getDBO();
$session    = JFactory::getSession();
$loginInfos = array(); 
if(!empty($session->get('login'))){
    $loginInfos = $session->get('login');
}else{
    $loginInfos = array("status" => "login", "username" => "", "password" => "");

    $session->set('login', $loginInfos);
}

$menuLogin  = "<div id='connexion'>
                <form name='input' action='$urlHere' method='POST'>
                    Username : <input type='text' name='usrn_Diffusion' />
                    Password : <input type='password' name='pass_Diffusion' />
                    <input type='submit' value='Submit' />
                </form>
               </div>";


#DEMO LINE
$passwordOnOff = true;
if($passwordOnOff){

    if(!empty(JRequest::getVar('pass_Diffusion')) && !empty(JRequest::getVar('usrn_Diffusion'))){
            $loginInfos["status"]           = "logged";
            $loginInfos["password"]     = JRequest::getVar('pass_Diffusion');
            $loginInfos["username"]     = JRequest::getVar('usrn_Diffusion');

            $loginInfos = $session->set($loginInfos);
    }
    if($loginInfos["status"] == "logged"){
        if($password == $loginInfos["password"] && $username == $loginInfos["username"]){

        }else{
            $loginInfos["status"]           = "loginError";
            $loginInfos["password"]     = "";
            $loginInfos["username"]     = "";

            $loginInfos = $session->set($loginInfos);
        }
    }else{
        $output = $menuLogin;
        exit();
    }

}

EDIT :

The error line seems to be this one :

if(!empty($session->get('login'))){
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:44:16+00:00Added an answer on May 28, 2026 at 2:44 pm

    Seems like you can’t use “empty” on the $session->get(‘login’)

    here’s the correct way to do this :

    if($session->get('login', false)){
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to modify a native joomla module that display articles of a category.
I want a FancyBox like that one in the gii module code generator. I
I want to build a module that adds an extra field on the search
Suppose you have a module that you know is safe. You want to mark
I have a class that I want to include in a GWT module. Unfortunately,
I have this module pattern that stores a bunch of vars. I want to
I want to learn C++ so that i can develop C++ Python modules for
Is there a python module that will do a waterfall plot like MATLAB does?
I need to display a page in drupal that is created by a template
I want to create a module that will find particular types of entities and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.