I have an HTML form with a form action of foo.php. However, when I click the submit button, I get redirected to the “foo.php”, but I don’t get redirected back to the page where the form is located. Could anyone tell me if there is some sort of code that is necessary for this to happen?
Here’s my PHP file, if this helps:
<?php
$title = $_POST['title'];
$content = $_POST['content'];
$postid = $_POST['postid'];
?>
You can set header redirect back to form file, after processing the form data. Assuming your form file has name “
form.php“