|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Save Javascript Variables to PHP/mySQL
Code:
<script type="text/javascript"> var pageViewerID = 02; var pageOwnerID = 01; var pageViewerFName = "cat"; var pageOwnerFName = "dog"; var pandoraRegFlag = '-1'; refreshCachedPage(); </script><script> |
|
#2
|
||||
|
||||
|
code development
You can pass javascript variables to PHP using GET POST and SESSION variables. But I'm a bit confused by your post example. Does this work?
|
|
#3
|
|||
|
|||
|
hey dOUbleOfour
there is no way to save javascript variables in javascript itself, apart from using cookies. but the technique is bit old and user is quite smart. But u can save it if u think well, i am doing this thing in my current project. i normally use two methode 1) after login definetly you will check user data in data base and the start ur clent script. so just befor that. in server side print all those variables e.g <? echo("<script languae=javascript> var x="+$x+"; var y="+$y+" </script>") ?> 2) use AJAX as simple as it is, save your variables once and retrive in asycro call. --------------------- i think it will help u. i personally thinks that to working with javascript language is not a problem, the thing u need is tricks. i always try to find some new. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Save Javascript Variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|