View Single Post
Old 12-24-2005, 10:22 AM  
broke
Confirmed User
 
Join Date: Aug 2003
Location: Someplace Windy
Posts: 4,501
You need to open and read the file and then rewrite the contents. Something like this (has not been tested)...

PHP Code:
$new_value "6";
$new_file "";

$handle = @fopen("y.php""r");
if (
$handle) {
   while (!
feof($handle)) {
       
$buffer fgets($handle4096);
       
       if(
stristr($buffer,'$a' !hahahaha FALSE)){
          
$new_file .= "$a = ".$new_value."\"";
       } else {
          
$new_file .= $buffer;

   }
   
fclose($handle);
}

$handle = @fopen("y.php""w");
if(
$handle){
   
fwrite($handle,$new_file);

__________________
Perfect Gonzo
broke is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote