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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:07:47+00:00 2026-06-02T09:07:47+00:00

I noticed this small bit of code above a controller on a demo codeigniter

  • 0

I noticed this small bit of code above a controller on a demo codeigniter project and wondered what it did and whether I should be using it.

defined('BASEPATH') OR exit('No direct script access allowed');

Also if I should use it where should it be used? controllers? models? both? etc..

  • 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-06-02T09:07:55+00:00Added an answer on June 2, 2026 at 9:07 am

    in order to activate the codeigniter framework the site must accessed with http://www.blahblah.com/index.php/params . By going through index.php first the framework is activated and various classes and whatnot are ran through PHP. The framework then looks at the parameters of the url and activates a specific controller. This line of code makes sure that the framework has been properly “booted up” and the user merely isn’t trying to run the single php file on the web server. Because that php file assumes that classes within the framework have already been declared, running a controller file on its own would fail miserably and has the potential for a security breach. No direct access allowed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After some code modifications, I suddenly noticed the project icon has a small red
I noticed This question , but my question is a bit more specific. Is
I’m exploring poll() function on a small project of mine, and I noticed that
Hey! I was looking at this code at http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html I noticed that in some
I've been working on a small aspx website all week; this morning I noticed
Noticed this today when a patch was submitted with the following line: lblCompletionTime.Text =
I noticed this site http://aspnetwebstack.codeplex.com/ . Is web forms source available?
I just noticed this about a week ago. I'm storing data about the current
I just recently noticed this behaviour. To put it shortly, it displays the commits
The first time I noticed this was with AlertDialogs putting the entire message on

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.