PHP interesse |
|
Hij doet het maar voegt geen gevens toe!
en als je scriptje 2x uit voert heb je ik de pagina 2x onder elkaar
of 3243x etc..
<?php
$cfg_file = "../include/config.inc.php";
$cfg_contents = file_get_contents($cfg_file);
$cfg_contents = preg_replace('{\$dbhost="(.+)?"}', '$dbhost="1"', $cfg_contents);
$cfg_contents = preg_replace('{\$dbuser="(.+)?"}', '$dbuser="2"', $cfg_contents);
$cfg_contents = preg_replace('{\$dbpass="(.+)?"}', '$dbpass="3"', $cfg_contents);
$cfg_contents = preg_replace('{\$dbnaam="(.+)?"}', '$dbnaam="4"', $cfg_contents);
$fp = fopen($cfg_file,'a+');
fwrite($fp,$cfg_contents,filesize($cfg_file)+1024);
fclose($fp);
?>
<?php $cfg_file = "../include/config.inc.php"; $cfg_contents = preg_replace('{\$dbhost="(.+)?"}', '$dbhost="1"', $cfg_contents); $cfg_contents = preg_replace('{\$dbuser="(.+)?"}', '$dbuser="2"', $cfg_contents); $cfg_contents = preg_replace('{\$dbpass="(.+)?"}', '$dbpass="3"', $cfg_contents); $cfg_contents = preg_replace('{\$dbnaam="(.+)?"}', '$dbnaam="4"', $cfg_contents); $fp = fopen($cfg_file,'a+'); ?>
|