note 118152 deleted from function.parse-ini-file by mazzanet
| From: | mazzanet@php.net | Date: | Fri, 16 Oct 2015 00:08:01 +0000 |
| Subject: | note 118152 deleted from function.parse-ini-file by mazzanet | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-203963@lists.php.net to get a copy of this message | ||
Note Submitter: info at djdb dot be
----
public function install(){
$config['iPROTECT'] = "<?php /*<!--";
$config['iamtheHOST']=(isset( $_POST['HOST'] )) ?
addslashes($_POST['HOST'] ) : '' ;
$config['iamtheDATABASE']=(isset($_POST['DATABASE'] )) ?
addslashes($_POST['DATABASE'] ) : '' ;
$config['iamtheUSER']=(isset($_POST['USER'] )) ?
addslashes($_POST['USER'] ) : '' ;
$config['iamthePASSWORD']=(isset($_POST['PASSWORD'] )) ?
addslashes($_POST['PASSWORD'] ) : '' ;
$config['PROTECTIONI'] = "-->*/";
if(isset($_POST['save'])){
if($this->connect($config['iamtheHOST'],$config['iamtheDATABASE'],$config['iamtheUSER'],$config['iamthePASSWORD'])){
$this->write_file($config);
return;
}
}
...form issues or print
}
function write_file($assoc_arr){
$content = "";
foreach ($assoc_arr as $key=>$elem){
$content .= ''.$key.' = "'.$elem.'"'."
\n";
}
//print $content;
if (!$handle = fopen($this->configfilename, 'w')) {
return false;
}
$success = fwrite($handle, $content);
fclose($handle);
return $success;
}
so write the lines
PROTECTION = "<?php /*<!--"
iamtheHOST = "***???***"
iamtheDATABASE = "***???***"
iamtheUSER = "***???***"
iamthePASSWORD = "***???***"
PROTECTIONI = "-->*/"