开发者

Writing html textfield value to PHP Session possible without refresh?

开发者 https://www.devze.com 2023-04-06 02:19 出处:网络
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.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号