This is what I have currently written at the end of my script on the second page.
$root = $_SERVER['PHP_SELF'];
$query = $_SERVER['PATH_INFO'].$_SERVER['QUERY_STRING'];
$wholeurl = "http://"."www.mypage.com"."$root"."?"."$query";
$newfile = "$newfile.html";
$fcontents = "$wholeurl";
$handle = @fopen("$fcontents","r");
$handle2 = @fopen("$newfile", "a");
if (!$handle) {
print ("Sorry - Unable To Open File For Reading.");
die;
}
$contents = fread ($handle, 1000000);
$newval1 = str_replace("form", "", "$contents");
print (" $newval1 ");
fwrite($handle2, $newval1);
fclose($handle);
fclose($handle2);