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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:11:28+00:00 2026-06-08T16:11:28+00:00

Currently i check user/pass in line 4 while the previous lines contain include php

  • 0

Currently i check user/pass in line 4 while the previous lines contain include php file for config and connecting to database and also a file that contain useful functions…

I wanna know is this wrong to check for Authority after include those file or it’s better to put it at top ?

  • Also i’m new in php

require_once(‘includes/config.php’);
require_once(‘includes/connection.php’);
require_once(‘includes/functions.php’);
checkAuthority();

PS: checkAuthority function has session_start() within it, while it’s not at the top right now but still works.

  • 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-08T16:11:34+00:00Added an answer on June 8, 2026 at 4:11 pm

    No, it is not wrong unless you are doing something in your included files that should only be done when a user is logged in. It looks though, that you include scripts that are nescessary to authenticate the user (e.g. a database connection).

    Also, no one says, session_start() must be executed before anything else is. There must not be any other output though before you execute session_start() (e.g. an echo). If you would echo something in config.php for example, session_start() in checkAuthority() would fail.

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

Sidebar

Related Questions

how can I check if a user (not the one currently logged in) is
How would I be able to check what language the user is currently viewing
Currently I am using ctype_alnum to check for alphanumeric type in csv file. But
I'm currently using checkboxes to set permissions within my PHP application. On the user
I currently have built a system that checks user IP, browser, and a random-string
I currently have form that checks if a user has unsubmitted changes when they
In my C# application, I need to check if the current user is a
We are implementing edi order processing and are currently about to check how we
Currently, in order to check if the Hibernate 2nd-level cache was used for a
Is there a way to check if some gem is currently installed, via the

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.