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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:28:53+00:00 2026-06-11T20:28:53+00:00

When it comes to programming your web application in php, what is the most

  • 0

When it comes to programming your web application in php, what is the most efficient way to prevent your MySQL information from being disclosed or discovered by another person (third party)? The information would include domain names and log in and passwords used in the connet functions.

For an example a good procedure might be keeping your mysql connection functions in a separate php file, etc.

Any ideas?

  • 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-11T20:28:54+00:00Added an answer on June 11, 2026 at 8:28 pm
    1. Keep your credentials in a separate .php file outside the document root (so it is not directly accessible over the web)
    2. It is better to keep it a .php file instead of, say, .inc, so that even if it is accidentally accessible over the web, it will be executed and not displayed directly
    3. Do not keep the username and password after you have established the connection (i.e., unset the vars or array keys holding the credentials after you don’t need them anymore); you cannot accidentally expose what you don’t have anymore
    4. Do not allow repeated inclusion of the credentials file (e.g. if (defined('DB_AUTH_LOADED')) return; define('DB_AUTH_LOADED', 1); in your credentials file), in order to avoid any possible redefinition of your credentials vars

    This should protect you from direct access to your credentials and from accidental leaks of the credentials by your own code. If attackers can upload PHP files to your server and manage to actually execute them, the fight is pretty much lost, but the above measures should keep you fairly safe from accidentally revealing your creds yourself.

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

Sidebar

Related Questions

let's say that you in your new programming work your boss comes and says
My programming background comes from C and some C++ programming with strong emphasis on
I'm programming a complex storyboard application and I'm encountering some issues when it comes
I am trying to learn java web programming. I come from a perl scripting
ok, so is there a programming language that frees you from clarifying your ideas
I'm a beginner when it comes to programming and Python. I've done most of
I am a beginner when it comes to programming with Android/Java, and I am
I am a complete noob when it comes to programming, so please bear with
While going through many resources on multithreaded programming, reference to volatile specifier usually comes
Programming has come a long way. I am still relatively young (first Computer: C64),

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.