I have a .js file calling a page title (document.title) and would like to use that title as a variable like: $star = the.js; What I am trying to do is bring the output from the .js file into the php file as the data for the variable. Is it possible?
Use AJAX to do that. process.php, is a separate document, it cannot be the same as the document.title one. function processTitle(){ var AdminRequest = window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(); var nTitle = "?title=" + document.title; AdminRequest.open("GET", "process.php"+nTitle, true); AdminRequest.send(null); } Code (markup): $star = $_GET['title']; Code (markup):