I know this is a very common question, but I could not find the answer
I'v post.php, which send the mail form to the .php controller. When it goes correctly, in the controller it does:
header("Location: ./post?ok=1");
the message is actually inserted, and it goes through the line above, but the URL in the browser seems to never change, and there was no ok parameter at the end,
I could use a session variable to store such a success / failure parameter, but this method should work
post.php:
<form action="controller" method="post"> <input name="test" value='test' type="text" /> <input type="submit" value="post" /> </form>
controller.php:
<?php header("Location: ./post?ok=1"); ?>
Change 1:
header("Refresh:1;url=http://localhost/test/post?ok=1");
Edit 2:
in post.php top I put
debug("post l ".count($_POST)); debug("get l ".count($_GET));
they display 0 before serving, and 0 after also
edit3: it works
blocked by:
if ($success){ header("Location: ./post?ok=1"); } header("Location: ./post");
which should be:
if ($success){ header("Location: ./post?ok=1"); } else { header("Location: ./post"); }
thanks all
user1125394
source share