I am using this code to make a php file become a javascript file
<?php
session_start();
header("Content-Type: text/javascript");
?>
Within the file, I need to get the document's url in both javascript and php.
Javascript returns the URL of the page, but PHP returns the URL of the script.
How can I force PHP to return the URL of the page?
My PHP echo $_SERVER["PHP_SELF"];
My JS var url = document.URL