sunil.23143 Posted September 16, 2008 Share Posted September 16, 2008 hello friends, how to change value of a php session variable in javascript.....or can we acces or change the value of a php session variable in javascript Quote Link to comment Share on other sites More sharing options...
paul2463 Posted September 16, 2008 Share Posted September 16, 2008 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 Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 16, 2008 Share Posted September 16, 2008 It can... Using AJAX and a script on a server side, at least session variables could be modified this way. Quote Link to comment Share on other sites More sharing options...
obsidian Posted September 16, 2008 Share Posted September 16, 2008 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.