My URL is http://www.website.ro/index.php?subiect=10046&pag=1#1006, and i have a form here with no action (<form action="" method="post">
).
After submit I'm checking some input fields and if there is any error, I want to redirect. I use this code:
header('Location: /index.php?subiect='.$_GET['subiect'].'&pag='.$_GET['pag']); exit();
But the redirect includes #1006 so my page becomes http://www.website.ro/index.php?subiect=10046&pag=1#1006
I tried to change location in the header with:
header('Location: http://www.google.com'); exit();
The page where takes me is : http://www.google.com#1006
Why does it do this?
I have ob_start()
at first line and i tried to deleted it. No effect. The url after redirect stil has #1006.
If my url is http://www.website.ro/index.php?subiect=10046&pag=1 and i use header location i don't have problems, but if the url contains #1006 the url after redirect contains to.