Javascript to PHP Variable

Hi,
In many cases, javascript alert, confirm or prompt are really useful and necessary. Some SC apps do not have the options for this.

In my case, i have a blank application. the user will be asked for confirmation. then a php script which is dependent to a variable will be executed depending on the response of the user.

Ex:
echo “<script>
if (confirm(‘Are you sure?’))
{
$test = ‘Y’; //how to do this right
}
else
{
$test = ‘Y’; //how to do this right
}
</script>”;

if($test==‘Y’)
{
//do this
}
else
{
//do that
}

The question is how to have the value of the variable $test from javascript and will be used in php?

https://forum.scriptcase.net/forum/main-category/main-forum/85160-prompt-confirm-values-in-php?p=85302#post85302
https://forum.scriptcase.net/forum/applications/grid-reports/8100-how-send-javascript-client-var-value-to-php-server-global-variable
https://forum.scriptcase.net/forum/scriptcase-8/discussion-aa/62524-passing-javascript-variables-from-one-application-to-another

Thanks robydago! you have always been very helpful…
Those links discuss scenarios involving more than one application.
In my situation, im trying to do this within just one blank application. I mean i would put all the scripts mentioned earlier
in the onExecute event of the lone blank app. Is it possible?

I don’t think it’s possible with just one blank app and all your code in a single event.
But I’m not an expert.
I wonder why you care to have everything in a single container

Im developing a modular dynamic system where each app functions like a piece of Lego puzzle which can be used in many modules of sub systems. I already have about about thousand apps so im trying to keep the number of apps at the minimum…

I hope there’s a way to do this, not an expert here…