store javascript variable in php
So, you have to reload the page to make it working. in javascript when ready save json , send json php page using ajax . or by pure js, see also on StackOverflow : JavaScript post request like a form submit BUT WHY try to set $_session with js? Declaring PHP variables. way save client side data without using forms. We will also be able to return the contents of that HTML inside a variable to output this in any place we want within our application. That is not how JavaScript and PHP interact with each other. Storing a javascript variable in a php string. I know that PHP happens server-side and javascript is executed once the page loads in the browser. Variables are used for storing values such as numeric values, characters, character strings, or memory addresses so that they can be used in any part of the program. All variables in PHP start with a $ (dollar) sign followed by the name of the variable. Hi, I have the following javascript function: