I’m developing a Telegram bot using a web app and facing challenges with getting data from the URL. The issue arises from the fact that the relevant information appears after the hash (#) in the URL, making it inaccessible via the standard $_GET array in PHP.
For context, here’s how my URL is structured:
https://mysite.com/app.php#tgWebAppData=query_id=BBFc4eW4BgAAAAFc4eW4ct8_Gi&user=%7B%22id%22%3A755232383%2C%22first_name%22%3A%22John%22%2C%22last_name%22%3A%22Doe%22%2C%22username%22%3A%22john_doe%22%2C%22language_code%22%3A%22en%22%2C%22is_premium%22%3Afalse%2C%22allows_write_to_pm%22%3Atrue%7D&auth_date=1704988707&hash=8c1357ce9f4e8825168cggfgc7cee9bef3a06827f47743e463de79f636949621
When I examine the content of the $_SERVER variable, I don’t find this information listed. Is there a method to retrieve this data with PHP? Should I consider altering my .htaccess file, or is it necessary to utilize JavaScript to first extract the fragment information?