I would redirect the original URL by adding a hash to the URL that will tell your site where to go.
When executed comment.php, it will respond with a 302 redirect with attached #contact. Say your page is being index.htmlredirected to
/index.html
About redirection in PHP: http://php.net/manual/en/function.header.php
In index.htmlyou should check the hash and do what you do when you click the link:
window.onload = function(){
if (location.hash === "contact") {
goto('#contact', this);
}
}
, , . index.php index.php #contact. PHP.
<form action="/index.php#contact" method="POST" ...>
...
</form>
1- : Javascript ( , script). , . #<name> id="<name>". CSS, onload.
: hash , goto(), , "".