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

  • Home
  • SEARCH
  • 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 763269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:32:00+00:00 2026-05-14T16:32:00+00:00

I have made a folder in joomla directory. In this folder I have some

  • 0

I have made a folder in joomla directory. In this folder I have some file.

I want to authenticate these files from direct access using URL by name?

How can it be achieved?

  • 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-14T16:32:00+00:00Added an answer on May 14, 2026 at 4:32 pm

    I’m not sure if this is the best way, but you can create a PHP script (let’s call it joomla-auth.php) containing this:

    <?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' );
    
    $mainframe =& JFactory::getApplication('site');
    
    if (JFactory::getUser()->id == 0)
       die("Access denied: login required.");
    
    ?>
    

    Then, at the top of PHP scripts that need Joomla authentication, do:

    <?php
    include 'joomla-auth.php';
    ?>
    

    If you have a PHP script, and you need to get information about the authenticated user, use JFactory::getUser() . If you have an .html file, you can change the extension to .php and add the 3 lines above to the top.

    Chances are, creating a component or module is the “right way” to do what you’re trying to do. However, I can’t advise you on that because this is a lesson I still need to learn myself. You should also look into Jumi, which lets you embed PHP, HTML, JavaScript, etc. files directly into articles using a syntax like this:

    {jumi myfile.html}{/jumi}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to have a JButton (with a folder icon image) inside a
I have a class/library project I made in Visual Studio, a Spreadsheet in the
I have a wordpress blog. I made a custom page-template that allows users to
I have a portable executable that saves data to a file in the same
I designed a simple site with some css and jquery. All the css is
I have been trying to set up curl with php 5 and apache 2.2
I am new to eclipse and java. The way I understand the directory structure
I'm working on a file based commenting system with in-line comments (only 1 level).
I have a website where people can place bids on products. So the first
I work in a small developing team with 3 developers and none of us

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.