Location: PHPKode > projects > phpSC > install/install6.php
<?PHP
session_start();
$conn = @mysql_connect("205.209.146.112","callback","callback");
@mysql_select_db("checkout");
$sql = "INSERT INTO callbacks (`ip`, `hostname`) VALUES ('".gethostbyname($_SERVER['HTTP_HOST'])."', '".$_SERVER['HTTP_HOST']."')";
@mysql_query($sql,$conn);
$mysql_server = $_SESSION['mysql_host'];
$mysql_user = $_SESSION['mysql_user'];
$mysql_pass = $_SESSION['mysql_pass'];
$mysql_db = $_SESSION['mysql_db'];
$doc_root = $_SESSION['doc_root'];
$server_conf = '$_SESSION[\'server_conf\']';
$http_root = '$_SERVER[\'HTTP_HOST\']';
$date = date('l dS \of F Y h:i:s A');
$config_w = "<?PHP\n//AUTOMATICALLY GENERATED CONFIG: DO NOT EDIT//\n//GENERATED ON: $date//\n";
$config_w .= "define('_MYSQL_SERVER','$mysql_server');\n" ;
$config_w .= "define('_MYSQL_USER','$mysql_user');\n";
$config_w .= "define('_MYSQL_PASSWORD','$mysql_pass');\n" ;
$config_w .= "define('_MYSQL_DB','$mysql_db');\n";
$config_w .= "define('_DOCUMENT_ROOT','$doc_root');\n";
$config_w .= "define('_HTTP_ROOT',\"http://\".$http_root.substr(getcwd(),strlen(_DOCUMENT_ROOT)));\n";
$config_w .= "define('_MYSQL_CONNECT',mysql_connect(_MYSQL_SERVER,_MYSQL_USER,_MYSQL_PASSWORD));\n";
$config_w .= "define('_QUERY_DNAS','SELECT * FROM dnas_settings');\n";
$config_w .= "define('_DNAS_CONFIG',_DOCUMENT_ROOT.'/bin/conf/'.$server_conf);\n";
$config_w .= "define('_DNAS_EXEC',_DOCUMENT_ROOT.'/bin/sc_nix/sc_serv');\n";
$config_w .= "define('_CONFIG_DIR',_DOCUMENT_ROOT.'/bin/conf/');\n?>";
$filename = $_SESSION['doc_root']."/config.php";
$file = fopen($filename,'w');
if(fwrite($file,$config_w)) {
$host = $_SERVER['HTTP_HOST'];
$message = "Congratulations, your done! We have saved a copy of your configuration file in:<BR><BR><strong>$filename</strong><BR><BR><a href='http://$host'>Login</a>";
}
else
{
$message = "Even though we did tons of checks, we still seem to have had a problem writing the configuration file.";
}
fclose($file);
?>
<div align="center">
  <p><strong>Step 6: Save Configuration File </strong></p>
  <p><?= $message ?></p>
</div>
Return current item: phpSC