Ok so im trying to write to my config.php from admin/index.php

Im managing to do this, BUT it erases everything and just writes to the php file what i asked.
I want it to alter the string not delete the lot lolz

Example

My config file looks like this ( or some of it anyway)

PHP Code: 
<?php

// Latest DVD

// Movie 1

$l1 "X-MAN";
$l2 "movie1.jpg";
$l3 "";


// Movie 2

$l12 "X-MAN";
$l22 "movie2.jpg";
$l32 "Hello World!";

// Movie 3

$l13 "X-MAN";
$l23 "movie3.jpg";
$l33 "";

My admin/index.php looks like this

PHP Code: 
$string = '<?php 
$l13 
"'. $_POST["l13"]. '";

?>';
 
$fp = FOPEN("config.php", "w");
FWRITE($fp, $string);
FCLOSE($fp);
 
}
 
?>
 
<form action="" method="post" name="install" id="install">
  <p>
    <input name="l13" type="text" id="l13" value=""> 
    l13 text
</p>
   <p>
    <input type="submit" name="Submit" value="Install">
  </p>
</form>

And the result looks like this AND ONLY THIS all other has gone

PHP Code: 
<?php 
$l13 
"pleasework";

?>
So its writing ok but i dont want it to write a new file just update the $l13 output


Help please

Cheers
RR
roadrunner Reviewed by roadrunner on . changing config.php via php page Ok so im trying to write to my config.php from admin/index.php Im managing to do this, BUT it erases everything and just writes to the php file what i asked. I want it to alter the string not delete the lot lolz Example My config file looks like this ( or some of it anyway) <?php Rating: 5