aight so what you need first is to read the file, then look on it line-by-line, if the line has expression that matches your from form change it, if it doesn't skip the line.
roughly somwthing like this:
<?php
if($HTTP_SERVER_VARS['REQUEST_METHOD']!='POST'){
print <<<EOF
<body><form action=$PHP_SELF method=post>change:<br>
from: <input type=text name=was><br>
to: <input type=text name=willbe><br>
<input type=submit value=done></form>
EOF;
exit;
}
//define your vars:
$yourfile="file name here";
$was=$HTTP_POST_VARS["was"];
$will_be=$HTTP_POST_VARS["willbe"];
$file=file($yourfile);
$link=fopen("$yourfile", "r+");
foreach($file as $line){
$line=eregi_replace("$was","$will_be", $line);
fputs($link, $line);
}
?>
of course here're millions of downsides and probably it looks ugly but my guess it's working (haven't checked yet - I am out on the job). If you have any problems email me I'll see whats wrong.
cheers,
AlCapone