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 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 have made a swing application which uses image files located in a folder
i have made a gridview which has many columns and the editmode , some
I have made a program with vb.net and I want that program to run
I have made some code which exports some details of a journal article to
I have made a program that list all files and folders(f&f) locating on sd
I have made this example and it works fine on a plain aspx webpage.
I have made an application project in Visual Studio 2008 C#, SQL Server from
I have a folder which php uploads to located in the directory above www
there is a user control on my Application.(App1) now I have made some changes
imagine i have made a co. Then I remove a folder inside the code

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.