{$_SERVER['SERVER_NAME']}: $titext\n";
# varx($_REQUEST);
$fn_pref='/var/www/vhosts/';
$fn2=substr($_SERVER['SCRIPT_FILENAME'],strlen($fn_pref));
$j=strpos($fn2,"/");
$fn_srvr=substr($fn2,0,$j);
if (!strlen($_REQUEST['f_prev'])) $_REQUEST['f']=substr($fn2,$j+1);
if (!($stat=stat($fn_full="$fn_pref$fn_srvr/{$_REQUEST['f']}"))) warn_msg("File not found");
if (strlen($_REQUEST['f_prev']) && $stat) {
if (isset($_REQUEST['subts'])) {
if ($_REQUEST['f']!=$_REQUEST['f_prev']) warn_msg("File name change. No stamping done");
else {
$newtim=strtotime($_REQUEST['t']); $res=false;
if ($newtim!=$stat['mtime']) {
if ($newtim) $res=(touch($fn_full,$newtim));
# will probably always work even if $newtim zero
if ($res) { warn_msg("Time stamp changed"); $stat['mtime']=$newtim; }
else { warn_msg("Timestamping to '{$_REQUEST['t']}' failed"); }
/* It does appear that stat($fn_full)['mtime'] issued at this point does not
reflect the effect of the touch(). And since strtotime() is very relaxed about
the formats it accepts, we need to update $stat[] rather than displaying
$_REQUEST['t'] as the new timestamp value */
}
}
}
}
echo "