Pull Data From the game

Quick question if I modify the index.html to have php code, could I pull data from MV and pass it. For ex -


If I had a PHP var called $actor_Name = Some MV Data Variable. 


then I did a echo $actor_Name could it display the data from mv?


So what I am asking is it possible to get MV data out of MV with out using HTTP request to send the data? 
what exactly do you want to do?


Most probably it would be easier to go the other way around, to have MV send that data when needed - because giving outside access may turn into a security problem on the website, depending on how it is done.
You can't assign a PHP variable to a JavaScript variable. You can only do it the other way around. A JavaScript variable can be assigned a PHP variable. 


EDIT: I said that wrong lol, or it just sounds confusing let me try and rephrase. A JavaScript variable can be assigned a PHP variable but a PHP variable cannot be assigned to a JavaScript variable.


So phpvar = jsvar is not possible but jsvar = phpvar is possible. You can't simply do it that way there is a special way of doing it but I don't know PHP that well. I just remember attempting the same thing you want to do and learning it's not possible.
To execute PHP code, you need to have PHP installed on the computer that is running it. And it can't interact with JS directly.


Even if it's the same computer, always imagine that PHP and Javascript are working on different computers. You can't make them talk to each other as if they were the same thing.


The only thing you can do is write PHP code that generates JS code to be executed along with the other JS later.
PHP can set a javascript var


javascript http request


php json_encode()


the two can communicate, I would go into details, but you can google too.


EDIT: (2nd glance, I read the op says no AJAX so I give you this)


Even if it's cross-server, it should take a JSONp. <script src="script.php?query" type="application/javascript"></script> I've recently learned that the thing is a browser.


Insert the tag with document.createElement and stuff too... I hope that's clear.
Thanks Every one - I got it working to how i need it to know. 

Original thread: https://forums.rpgmakerweb.com/threads/pull-data-from-the-game.74133/