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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:07:04+00:00 2026-06-12T09:07:04+00:00

First off, I’m sorry if this shows no code which is not what Stack

  • 0

First off, I’m sorry if this shows no code which is not what Stack Overflow is about..But I have no clue where to go on this. I have a basic CMS I made, and I am trying to distribute it. I want to make it so that upon going to /cms/install for example, they set the database info, and different info to integrate into the CMS. Now my issue is, what would be the best method to allow the user to store that database info? A cookie seems to not be the right way..Could I store database info inside of a database? Not too sure where to go on this. More or less. What is the best way to temporarily store the database information the user gave before arrival of the full CMS.

<?php 
$fopen = fopen('config.php', 'w'); 
fwrite($fopen, '1'); 
write($fopen, '<?php $dbname = '$_POST['database']'; $dbpassword = '$_POST['password']';     ?>'); fclose($fopen); 
?> 

Would this work?

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

    Create a script that generates a config file (e.g. config.php) with the database connection variables.
    Don’t forget to set the right file-permissions after you done with a new config file.

    Update:

    $config .= "<?php\n"; 
    $config .= "\$database = '".$_POST['database ']."';\n";
    $config .= "\$user= '".$_POST['user']."';\n";
    $config .= "\$pass= '".$_POST['pass']."';\n"; 
    $config .= "?>\n"; 
    
    file_put_contents("config.php", $config);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First off I use this code to make the navigation bar always stay fixed;
first off this is a class assignment so i would appreciate help but just
First off, I will say i've spent 6 hours on this topic and have
First off, please accept my apologies if this question is basic, I mainly have
First off I have an app that provides the user information about the amount
First off, this is part of an extra credit homework, so please do not
First off, I need to give a disclaimer: DO NOT RUN THIS JAVASCRIPT It
First off, I'm using Access 2000 and DAO. I have code that executes a
First off, I am cross-posting this from Server Fault because I did not receive
First off: Everything works , but I would like to fine tune this a

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.