I'm not sure exactly what you're doing, but the root of the issue is that browsers don't send the URL fragment (the '#W23' part at the end) to the server in the HTTP request. The browser retains it to display the page and, once loaded, uses it to scroll the page as desired, but that's all. One solution would be to include that information in your URLs twice: once as a part of the query string and once as the URL fragment. For example:
But the only way to get the information to the PHP script is to include it as a query string parameter.