dunno why you would want to do it. It is even pretty much impossible to be completely sure afaik. But you can check the http_referer. This would rule out most people, though it is possible to fake the http_referer too.
otherwise, you could define a secure hash on the first form and pass that one too.
on the form:
$time= time();
$hash = md5($time."secretvar");
store both in the form as hidden var.
on the action.php:
$current_time = time();
if ($current_time - 5*60 > $time) {
// too long ago
echo "form timed out";
}
else {
// check if hash is correct
$current_hash = md5($time."secretvar");
if ($current_hash == $hash) {
echo "ok";
}
else {
echo "false time or hash";
}
}