0

I'm trying to get the URL query next the "#!" prefix, for example: https://mega.co.nz/#!123abc

<?php
$query=$_GET["#!"]; //the example
?>

$query: 123abc.

It is possible to read the query using PHP or .htaccess file? How i can get started?

Thanks for reading and for any help! :)

Vega
  • 59
  • 5
  • 2
    See this answer : http://stackoverflow.com/a/940923/5645769 – Tᴀʀᴇǫ Mᴀʜᴍᴏᴏᴅ Dec 25 '15 at 11:06
  • 1
    Also this answer explains better : http://stackoverflow.com/a/2317523/5645769 – Tᴀʀᴇǫ Mᴀʜᴍᴏᴏᴅ Dec 25 '15 at 11:12
  • 1
    Yeah that solved my problem :) As conclusion isn't possible to read the fragment after the hash # using pure PHP, but yes with some helps of JavaScript: http://www.stoimen.com/blog/2009/04/15/read-the-anchor-part-of-the-url-with-php/ Thanks a lot! I hope won't have problems trying to read the "!" symbol in JavaScript. Regards! – Vega Dec 25 '15 at 11:18

1 Answers1

-1

Try this, Let your URL:

 https://mega.co.nz?query=123abc

Then you can get value as below :

 <?php
     $query=$_GET["query"]; //the example
 ?>
AkshayP
  • 2,141
  • 2
  • 18
  • 27
  • Thanks a lot for the answer! But I need to use the #! prefix to make the links unredeable for some content stealing bots. I think this is possible using a some Regex inside the .htaccess, sending the query readable to PHP without changing the visitor URL (in bacckground I guess), but.... I don't know how to get started :S. Regards! :) – Vega Dec 25 '15 at 11:00