I'm trying to echo current url after ? with # symbol. But it isn't possible with php. So I have to do that with javascript. But I have no knowledge about javascript. This is the url:
I want to get after ? like:
And echo to screen with php.
I tried everything I've found but I didn't make it.
<script type="text/javascript">
var pageName = (function () {
var a = window.location.href,
b = a.lastIndexOf("#");
return a.substr(b + 1);
}());
$(document).ready(function(){
$("#element-id").html(pageName());
});
</script>
<?php
echo '<div id="element-id"></div>';
?>
I expect the output
https://mega.nz/#!link!pass But the actual output is empty.