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 7520583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:05:45+00:00 2026-05-30T02:05:45+00:00

I try to fetch my users information using the getUser() function with a php

  • 0

I try to fetch my users information using the getUser() function with a php script located in a iframe (wrapper) of Joomla. It seems there is problem passing parameters to iframe code. The only way I can catch user informations is to insert the code into a basic article (which is not an iframe).

The var_dump($user); output shows :

object(JUser)#17 (23) { ["isRoot":protected]=> NULL ["id"]=> int(0) ["name"]=> NULL ["username"]=> NULL ["email"]=> NULL ["password"]=> NULL ["password_clear"]=> string(0) "" ["usertype"]=> NULL ["block"]=> NULL ["sendEmail"]=> int(0) ["registerDate"]=> NULL ["lastvisitDate"]=> NULL ["activation"]=> NULL ["params"]=> NULL ["groups"]=> array(0) { } ["guest"]=> int(1) ["_params":protected]=> object(JRegistry)#18 (1) { ["data":protected]=> object(stdClass)#19 (0) { } } ["_authGroups":protected]=> NULL ["_authLevels":protected]=> NULL ["_authActions":protected]=> NULL ["_errorMsg":protected]=> NULL ["_errors":protected]=> array(0) { } ["aid"]=> int(0) }

Some idea of what is going wrong ?
Thank you,
Florent

<?php

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' );

$user = JFactory::getUser();

echo "<p>Your name is {$user->name}, your email is {$user->email}, and your username is $user->username}</p>";
echo "<p>Your usertype is {$user->usertype} which has a group id of {$user->gid}.</p>";
//var_dump($user);
?>  
  • 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-30T02:05:46+00:00Added an answer on May 30, 2026 at 2:05 am

    As previously said, wchen you use a wrapper, the Joomla environment is unknown. So you need to embed this before using Joomla API. To do this, just copy and paste this code (or create a new PHP file and include it in your custom page) :

    <?php
    define('_JEXEC', 1 );
    define('JPATH_BASE', $_SERVER['DOCUMENT_ROOT'] ); 
    define( 'DS','/' );
    
    require_once ( JPATH_BASE.DS. 'includes'.DS.'defines.php' );
    require_once ( JPATH_BASE.DS.'includes'.DS.'framework.php' );
    require(JPATH_BASE.DS.'libraries/joomla/factory.php');
    
    $mainframe =& JFactory::getApplication('site');
    $mainframe->initialise();
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to fetch a Wikipedia article with Python's urllib: f = urllib.urlopen(http://en.wikipedia.org/w/index.php?title=Albert_Einstein&printable=yes) s
in my application i try to fetch users location but it always 0.0 for
I try using FQL Query to fetch count of share from post on facebook
I use kohana and when you try to fetch data from database it returns
I have a php script that comes down to the following: while ($arr =
Im writing a login script. My db.php doesnt echo/print anything so why doesnt header(Location:
Every time I try to run my script I get this error, saying that
When I try to execute script PutEnv(TNS_ADMIN='C:\\Programy\\OracleDeveloper10g\\NETWORK\\ADMIN\\'); $conn = oci_connect(user, pass, dbstring); if (!$conn)
I have a little problem with my script. When I try to run it
I have a web based system where users should be able to fetch data

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.