All pastes #911635 Raw Edit

Anonymous

public text v1 · immutable
·published 2008-02-20 20:51 UTC
rendered paste body
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 <br/>";
	print "	$prox->ezText";
}else {
	print "the string ### was found in <br/>";
	print "at prossition $headerpos";
	fseek($prox->proxFile, $headerpos);
	$place=ftell($prox->proxFile);
	print " $place";
	$myline=fgets($prox->proxFile);
	print "$myline \n <br/>";
	fseek($prox->proxFile, strlen($myline));
	fputs($prox->proxFile,"this is where i write <br/> \n");
	print "$ezText" ;
	fpassthru($prox->proxFile);
	
}
?>