There are multiple pages. There are links on these pages. These links leads to a page with a form. When the form is submitted, the page that holds the form refreshes itself
This concept is known as Post-Redirect-Get. The question is: is the user always going back to the same static original page, or are there many pages that can lead the user to this form? If the latter is true, simply add the referer ($_SERVER['HTTP_REFERER']
) as a form element to record where they came from. php code:
redirect($_SERVER['PHP_SELF']);
}
else {
$this->redirect("original-user-location", true, 303);
}
}
private function redirect($loc) {
header("Location: $loc", true, 303);
exit;
}
//ignore PUT, DELETE
public function __call($_, $_) {}
}
controller::_()->$_SERVER['REQUEST_METHOD']();
?>