JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old May 15th, 2006, 05:52 AM
dOUbleOfour dOUbleOfour is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2006
Posts: 2 dOUbleOfour User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 32 m 43 sec
Reputation Power: 0
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>

Reply With Quote
  #2  
Old May 15th, 2006, 11:13 AM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 540 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 1 h 41 m 16 sec
Reputation Power: 3
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?

Reply With Quote
  #3  
Old May 16th, 2006, 08:44 AM
ravs ravs is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2006
Location: gurgaon, haryana, india
Posts: 60 ravs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 44 m 29 sec
Reputation Power: 3
Send a message via Yahoo to ravs
Thumbs up

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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Save Javascript Variables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway