I want to be able to write some data to the PHP session AFTER the page has loaded, and BEFORE the page proceeds to the next page.
for example, this is a PHP file:
<input type="text" value="abc" />
<input type="button" onClick="doSomething开发者_运维问答()" />
How do I write "abc" to the php session (or whatever the user has typed in the textfield) in the javascript function doSomething()? Is this possible?
you can use ajax to pass the value to php while the page is open
this was on the "related" sidebar on the right, for reference How to use jQuery AJAX $.post to store PHP $_SESSION variables?
精彩评论