HTTP_REFERER doesn't work

I do:

        ExecuteQuery ...
	if (isset($_SERVER["HTTP_REFERER"])) {
		header("Location: " . $_SERVER["HTTP_REFERER"]);
	}

in a custom php-file to return back to invoking page. This doesn’t work in PHPMaker 2021?
So I have tried:

print '<html><head><script type="text/javascript">history.back();</script></head><body /></html>';

But this doesn’t show the updated values in invoking page in Safari under iOS and iPadOS.
How can I do this better?

anbra wrote:

> > if (isset($> SERVER["HTTP_REFERER"])) {

header("Location: " . $> SERVER[“HTTP_REFERER”]);
}

You need to exit the page after setting the header, e.g.

header("Location: " . $_SERVER["HTTP_REFERER"]);
exit;

Thank you very much.
That was the solution. It works!