You will have to use POST/GET to send a JS variable to PHP, because PHP is processed by the server and JS is processed by the client.
I know this isn’t what you want to hear.
solved Passing jQuery variable to PHP on the same page?
You will have to use POST/GET to send a JS variable to PHP, because PHP is processed by the server and JS is processed by the client.
I know this isn’t what you want to hear.
solved Passing jQuery variable to PHP on the same page?