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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:03:22+00:00 2026-05-21T12:03:22+00:00

Possible Duplicate: Reading and Writing Configuration Files Okay, I have a config file, which

  • 0

Possible Duplicate:
Reading and Writing Configuration Files

Okay, I have a config file, which contains some information that I would like the user to be able to change. I’ve already thought about holding the information in a MySQL table but this isn’t a good idea as I’ve got my Database class included AFTER my configuration variables and this would mess up my code structure.
Any idea how to read/write variables/specific lines of a file? Here’s my global config file.>

error_reporting(E_ALL);

/*
    The parameters used site-wide
    First set are Datbase parameters
    And second set are the salts used to generate strings
*/
$params['db']['host'] = 'localhost';
$params['db']['username'] = 'root';
$params['db']['password'] = 'waffliner';
$params['db']['db_name'] = 'habcms';

$params ['core']['salt1'] = "184962574320355793361124913390";
$params['core']['salt2'] = "13952134426315134482857516025";

$params['core']['timeout'] = "60 minutes";


try {
    include_once("core.inc.php");
    include_once("db.inc.php");
    include_once("user.inc.php");       
} catch(exception $e) {
    echo $e->getMessage();
}

?>

  • 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-21T12:03:23+00:00Added an answer on May 21, 2026 at 12:03 pm

    If you want to do so, you need to store you configuration in a non-PHP file.

    You can, for example, store your config in an .ini file and read it with parse_ini_file().

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

Sidebar

Related Questions

Possible Duplicate: Reading/Writing MS Word files in Python I know there are some libraries
Possible Duplicate: Reading dll.config (not app.config!) from a plugin module. I have two different
Possible Duplicate: Reading the last n lines from a huge text file I have
Possible Duplicate: Reading and writing images to an SQLite DB for iPhone use How
Possible Duplicate: Reading through file using ifstream I'm trying to find a way to
Possible Duplicate: How to detect if JavaScript is disabled? I have a website which
Possible Duplicate: Writing C# Plugin System Is it possible to write a program that
Possible Duplicate: Reading PDF documents in .Net How do I read a pdf file
Possible Duplicate: How to assign Profile values? I'm reading an ASP.NET book that says
Possible Duplicate: Write a recursive function that reverses the input Recently, I've been reading

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.