Page 1 of 1
Passing javascript variables to either PHP or CGI
Posted: Wed Oct 18, 2006 8:47 pm
by boryev
Hello!
I came across this script :
Code: Select all
<script type="text/javascript">
var pageViewerID = "somenumbers";
var pageOwnerID = "somenumbers";
var pageViewerFName = "someone'sname";
var pageOwnerFName = "someone'sname";
var pandoraRegFlag = '-1';
var userHasBlog = 't';
var HbxTrackingEnabled = false;
</script>
Its taken from a social networking site where my profile is located! The pageViewerID and pageViewerFName would change everytime a different person views my profile! Now, my question is, how do I store/pass those pageViewerFName and pageViewerID variables to a PHP or CGI page so that the data would be stored and I could see who viewed my profile just by viewing the PHP / CGI page?
Please help me!
Thank you in advance!
Posted: Wed Oct 18, 2006 9:04 pm
by feyd
Construct a URL out of them and request something from wherever the PHP file is hosted. An image, some Javascript, something. It's usually better to use an image for various reasons.
Posted: Wed Oct 18, 2006 9:09 pm
by boryev
feyd wrote:Construct a URL out of them and request something from wherever the PHP file is hosted. An image, some Javascript, something. It's usually better to use an image for various reasons.
How will I?
Posted: Wed Oct 18, 2006 9:11 pm
by feyd
How will you... construct a URL?
http://somesite.com/path/to/a/file.php? ... me2=value2
You probably should be using the escape() function of Javascript on the values (at least).
Posted: Wed Oct 18, 2006 9:16 pm
by boryev
Posted: Wed Oct 18, 2006 9:17 pm
by feyd
boryev wrote:
url of what?
feyd wrote:An image, some Javascript, something. It's usually better to use an image for various reasons.

Posted: Wed Oct 18, 2006 9:21 pm
by boryev
feyd wrote:boryev wrote:
url of what?
feyd wrote:An image, some Javascript, something. It's usually better to use an image for various reasons.

How will I display my profile viewers?
Posted: Wed Oct 18, 2006 9:26 pm
by feyd
However you like. The file/script/whatever you request will need to record it in some fashion that you can later extract data from; be it database, flat file, some other storage media is up to you.
Posted: Wed Oct 18, 2006 9:28 pm
by boryev
feyd wrote:However you like. The file/script/whatever you request will need to record it in some fashion that you can later extract data from; be it database, flat file, some other storage media is up to you.
How will I do it in PHP and MYSQL?
Posted: Wed Oct 18, 2006 9:33 pm
by feyd
boryev wrote:How will I do it in PHP and MYSQL?
What do you have so far?
What is your knowledge level of PHP? .. of MySQL? I'll tell you up front, if you're looking for me to write it for you, you're going to be disappointed; I won't do it.