如果存在验证错误,则将php表单重定向到引用页面上的书签

My php form mailer has this line of code that sends the user back to the form page if there was a validation error:

header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true");

It works fine, but the thing is that my form is at the bottom (footer) of the referring page. When there is an error, it simply goes back to the (top of the) referring page, but the user cannot see there was an error because it does not scroll down to the form.

I do have an HTML bookmark for that section, but I don't know how to add it to the code above so it will automatically scroll down to the form.

Is there anything I can add to the code above so it redirects down to that form part of the referring page, as in an anchored link like www.example.com#form?

Put the anchor before the query params i.e. example.com#errors?subject{$subject}&x=y