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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:13:25+00:00 2026-06-14T14:13:25+00:00

Is it necessary to unset my password variable for my MySQL database. Currently, my

  • 0

Is it necessary to unset my password variable for my MySQL database.

Currently, my code for my “dbpwd.php” is like this:

# database setup
$dbserver = "localhost";
$db_usrname = "blah";
$db_pwd = "blahblahblah";
$dbname = "blah";

but I was thinking…. is this a securtly concern.. because anyone can just do this:

 <?php
 include 'http://www.mywebsite.com/dbpwd.php';
 echo $db_usrname;
 echo $db_pwd;
 ?>

Wouldn’t that give them full access to my stuff… so is it good practice to unset variables that are sensitive at the end of your php code? or is there something that I am missing?


Edit to clarify…

In this situation listed above… they would be using their own php server (not mine), and using include from there php file to get information from my server.

  • 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-14T14:13:26+00:00Added an answer on June 14, 2026 at 2:13 pm

    If someone attempts to perform a remote include via allow_url_fopen to your script, remember that from your server’s point of view that is a regular HTTP request. A properly configured server would then execute the PHP code, rather than send it down as source. So what they would receive, assuming your database configuration file produces no output, would be a blank document. They would not see or have access to your variables.

    The result is the same as if you pointed your web browser to http://www.mywebsite.com/dbpwd.php. You would see a blank page.

    As I mentioned though, this relies on your web server being properly configured to execute PHP code (which it should be if your code runs when requested otherwise). It is always recommended though, to place sensitive files outside the server’s document root to avoid this issue should your server ever become incorrectly configured.

    To answer the other part of your question, you do not need to unset any variables. PHP will clean them up when they are no longer needed, and they are not a danger to your security.

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

Sidebar

Related Questions

I'm struggle extracting necessary data from this json stored inside php variable. Not yet
struggle extracting necessary data from this complex json stored inside php variable. Via php
Is it really necessary do something like this: /** * ... * * @return
I have a system setup like this: http://joemaller.com/990/a-web-focused-git-workflow/ However no matter how I configure
What references are necessary to have fluent nhibernate work with mysql. I have downloaded
I'm writing a simple linear linked list implementation in PHP. This is basically just
Is it necessary or advantageous to write custom connection pooling code when developing applications
Sometimes its necessary to code in AS2 to target Flash Player 8, so we're
I want to keep password which is given by user in a variable. Where
Is it necessary to parametrize the entire interface for this scenario, even though Bar

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.