So there are 2 pages page1.php and page2.php
page2.php needs to pass JS variables to page1.php
We can do this by passing it as url variables from page2.php and get it in page1.php using $_GET[].
page2.php (send JS variable)
page1.php (receive JS variable)