I do not know if the question was formulated correctly but anyway ... My problem is this:
The user will enter such a code and click on search. This request will go through a PHP that will check if this code is present in the code.txt file and open a page with a table containing data related to the code or open an error page if the code is incorrect:
$track = $_POST['code'];
$codigo = file_get_contents("codes.txt");
$codigo = explode(PHP_EOL, $codigo); // PHP_EOL is for a line break
if(in_array($track, $codigo)){
header("LOCATION: pages/track.html?code=$track");
} else {
header("LOCATION: pages/error.html");
}
My problem is that I wanted the url to always look like this: myite.com/pages/track.html?code=$track
Just changing the parameter ($ track), otherwise I would have to create a page for each code. And every different code / parameter would display a DIV containing one table and hide the other.
Example:
The user was on the initial page typed the correct code (123456789) in the search box and went to page myite.com/pages/track.html?code=123456789 showing in a table the data referring to that code and on the same page he typed another correct code (111222333) and just changed the url parameter, so: myite.com/pages/track.html?code=111222333. And along with the new parameter was hidden the other table and shown the new table that contains the data referring to this new code. Anyway, I just wanted to change the content of the page but preserved the url template: myite.com/pages/track.html?code=$track ... I thank those who have read here and apologize for the lack of accent , and that my keyboard is in trouble.