Passing JavaScript Variable to PHP Session variable

前端 未结 5 466
梦谈多话
梦谈多话 2021-01-24 00:47

I am trying to update/create session variable when I change the option thru a drop-down box. TThe value is stored in a javascript function. Can any1 tell me how I can pass this

5条回答
  •  时光说笑
    2021-01-24 01:07

    You can't really.

    Session data is altered with the server, while Javascript can only alter client-side data (such as cookies). You can, however, create a solution by creating a new PHP page that passes a variable within the GET/POST request, then alters the session.

提交回复
热议问题