$site="http://domain/form.html";
$fp=join("", file($site));
$fp=preg_replace('|(action=".*")|', 'action="'.$PHP_SELF.'"', $fp);
echo $fp;
that takes the page (form.html) and changes all action="whatever" to action="<script name>". It's not perfect, but it's free 🙂
suggestions: make the pattern more accepting, and only make it replace in forms.