I made a product page that loads information from the database, using variables in the URL of the page. But when I use `header("Refresh:0"); the variables get deleted form the URL. Is there a way too prevent this?
HTML:
if(isset($_POST["Logout"])) {
$_SESSION["loggedin"] = "no";
setcookie("login", "yes", time()-3600, "/");
setcookie("name", "", time()-3600, "/");
header("Refresh:0");
}
URL before logout is pressed:
blabla.nl/index.php?id=1234
URL after logout is pressed:
blabla.nl/index.php
$_SERVER["PHP_SELF"]
does not include any parameters added to the URL, just use an empty action=""
and it will submit to it's self, including any parameters added to the URL.
Edit: your form should look like this:
<form method="post" action="">
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments