function __construct() { print "constructing,"; $this -> proxFile=fopen("file.cfg","r+"); //resource print "test,"; $this -> ezText = file_get_contents("file.cfg"); print "test,"; } and the user code is ?php include("EZprox.php"); $prox = new ezproxy; $headerpos = strpos($prox->ezText , "###"); if ($headerpos === false) { print "### was not found in
"; print " $prox->ezText"; }else { print "the string ### was found in
"; print "at prossition $headerpos"; fseek($prox->proxFile, $headerpos); $place=ftell($prox->proxFile); print " $place"; $myline=fgets($prox->proxFile); print "$myline \n
"; fseek($prox->proxFile, strlen($myline)); fputs($prox->proxFile,"this is where i write
\n"); print "$ezText" ; fpassthru($prox->proxFile); } ?>