To start, I am not asking if I can create a POST response from one page to another without use of a form or one of the similar questions which may come to mind. At the start of several of my pages, I automatically force https security with the following require statement:
<?php
if($port == 80) {
if($_SERVER['SERVER_PORT'] == 443) {
header('Location: http://'. $_SERVER['HTTP_HOST'] . $_SERVER["REQUEST_URI"]);
exit;
}
} elseif ($port == 443) {
if($_SERVER['SERVER_PORT'] == 80) {
header('Location: https://'. $_SERVER['HTTP_HOST'] . $_SERVER["REQUEST_URI"]);
exit;
}
}
?>
where $port is set directly before calling the PHP require. In some instances where directing from a http to https (or simply changing the URL by person), any POST variables generated from the form on page 1 would be lost on the redirect.
Maybe I am asking the same question as the 'no form' but if so, any advice on how to handle based on the requirements is appreciated.
Thoughts
I could put everything into SESSION but this seems like a huge waste of resources. Unless somebody can really show otherwise, I don't consider this a solution.