All I have had good luck getting PHP pages to execute Javascript inside of them to do work on the local drive… making virtually anything that can be done in HTML with Javascript also work with [PHP/HTML Rendered Pages/ And Javascript]
but if the script is below the PHP page…..
$stewsvariable = 32;
UpdateStewsvariable();
function UpdateStewsvariable()
{
var x = 32;
$stewsvariable = x;
}
‘;
The script is essentially a child process of the parent.
I am wondering if anyone has had luck getting the Child Process to update a Parent Variable in some method? Without calling another page via POST or GET?
I have seen some answer of just making the Javascript execute a JQUERY Post via AJAX, but its not communicating back to the parent process. Thoughts?
I am generally referring to these types of actions Hades Scripting… where the PHP server is communicating to the Browser via Javascript….but its more like Cloud to Desktop activity.
1
The script is essentially a child process of the parent.
No, it isn’t. The PHP part is executed on the server, and the output sent to the browser, which executes the javascript. $stewsvariable
in PHP is distinct from $stewsvariable
in Javascript.
Variables are not shared between PHP and the browser.