Quick Search:
Oracle PL/SQL Code Library
Find Or Post Oracle Jobs
Oracle Discussion & Chat
 PHP Code: How to write a config file Jump to:  
Category: >> PHP Code >> How to write a config file Bookmark and Share

<< lastnext >>

Snippet Name: How to write a config file

Description: Easy way to collect user data and write it to a config file (for example, during an install).

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: February 28th, 2009

IF (ISSET($_POST["Submit"])) {
$string = '<?php 
$dbhost = "'. $_POST["dbhost"]. '";
$dbuname = "'. $_POST["dbuname"]. '";
$dbpass = "'. $_POST["dbpass"]. '";
$dbname = "'. $_POST["dbname"]. '";
$prefix = "'. $_POST["prefix"]. '";
$user_prefix = "'. $_POST["user_prefix"]. '";
$dbtype = "'. $_POST["dbtype"]. '";
$fp = FOPEN("config.php", "w");
FWRITE($fp, $string);
<form action="" method="post" name="install" id="install">
    <input name="dbhost" type="text" id="dbhost" value=""> 
    DB Host
    <input name="dbuname" type="text" id="dbuname"> 
    DB Username
    <input name="dbpass" type="password" id="dbpass">
  DB Pass </p>
    <input name="dbname" type="text" id="dbname">
  DB Name </p>
    <input name="prefix" type="text" id="prefix">
  DB Prefix</p>
    <input name="user_prefix" type="text" id="user_prefix">
    <input name="dbtype" type="text" id="dbtype">
  DB Type </p>
    <input type="submit" name="Submit" value="Install">

Oracle Magazine
and Oracle White Papers

SQL University.net courses meet the most demanding needs of the business world for advanced education in a cost-effective manner. SQL University.net courses are available immediately for IT professionals and can be taken without disruption of your workplace schedule or processes.

Compared to traditional travel-based training, SQL University.net saves time and valuable corporate resources, allowing companies to do more with less. That's our mission, and that's what we deliver.

Click here to find out more
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 235 users online    © 2009 psoug.org

Forgot your password?