Jump to content

how to change value of a php session variable in javascript


sunil.23143

Recommended Posts

PHP is a server side script, all variables are set at the server before being given over the the client

 

Javascript is a client side script working with what it has been given

 

to change a php variable and maintain it as a php variable then php server side has to do the change, hence you would have to pass it back to php, allow it to make the change and then pass it back to the client

 

so in other words javascript cannot change the value of a php variable

It can... Using AJAX and a script on a server side, at least session variables could be modified this way.

 

True, but what paul2463 says is still true: JavaScript cannot change the session variable. It can submit the request and provide the value to another script, but it will still require a PHP (or other server side) script to do the data manipulation ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.