have this script
$idhandle = fopen($filename, 'r+') or die("can't open file");
$id = "<?php \$lastid = \"$lastid\"; ?>";
fwrite($idhandle, $id);
fclose($idhandle);
trying to write "<?php \$lastid = \"$lastid\"; ?>"; in the first line of the file but what is happening is its deleting some of my code in the file. any way that you can skip a line or someting to preserve the coding that is already in the filename ?