PHP inside javascript
Posted: Thu Mar 07, 2019 1:17 pm
Hi,
I would like to place PHP code inside the javascript:
For example the following code place inside the PHP before save is adding one row to the table:
is it possible to execute equivalent code from JavaScript I mean to have someting which I could use for example in the buton /custome code / java script / onclick option.
Belowe just a not working sketch of what I would like to achieve:
I would like to place PHP code inside the javascript:
For example the following code place inside the PHP before save is adding one row to the table:
Code: Select all
$t="INSERT INTO parts(par_sample_id_number,par_req_nr) VALUES ('test1','req1')";
$x=nuRunQuery($t);
Belowe just a not working sketch of what I would like to achieve:
Code: Select all
var a1 = $t="INSERT INTO parts(par_sample_id_number,par_req_nr) VALUES ('test1','req1')"; ????
var a2 = $x=nuRunQuery($t); ???
var a = a1 + a2; ???
nuRunPHPHidden(a, '');