Jump to content


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


Save Javascript Variables to PHP/mySQL

Recommended Posts

I have this code in my web

[code]<script type="text/javascript">
   var pageViewerID = 02;
   var pageOwnerID = 01;
   var pageViewerFName = "cat";
   var pageOwnerFName = "dog";
   var pandoraRegFlag = '-1';

This is the piece of my profiles code. Everytime someone visits/open my profile the "var pageViewerID" changes depending of what's the visitors ID and also the "var pageViewerFName".

And i want to know who whowed my profile so that im wondering if is it possible to save those "var pageviewerID" and "var pageViewerFName" to a log like PHP or mySQL?

Share this post

Link to post
Share on other sites
anyone please... [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]

Share this post

Link to post
Share on other sites
The only way this can be done is to use AJAX (asynchonous Javascript) to start a small PHP script in the background on the server. If you are unfamiliar with AJAX, there is a sister forum to this one on [a href=\"http://www.ajaxfreaks.com/\" target=\"_blank\"]ajaxfreaks.com[/a]. You can also take a look at the [a href=\"http://developer.yahoo.com/yui/connection/\" target=\"_blank\"]Connection Manager[/a] in the Yahoo! Developer Network.


Share this post

Link to post
Share on other sites


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.