Hi all,
This is my first post, so please be gentle. I have also posted this in the Perl forum because it uses both technologies. The end goal is to collect some client side values (browser type, OS, screen resolution, etc.) and then pass those values to a cgi script so they can be entered in a database. Another option is to write the data to a log file, or better yet use cgi to collect the variables directly (don't think that's possible). I have been fulling around with AJAX, but can't quite get it to work. Here's what I have for the JavaScript...
The function is executed in the onclick method ...
I hard coded the parameter for testing purposes only. Once I get it working right I can easily create the parameter based on the browser the user is using.
Here is the cgi script (again, short and sweet for testing only) ...
All it does is write the number of parameters it recieves to a file on the server.
What is happening is that the parameters are not being passed, and the cgi sctript executes over and over and over, rewriting the file even after the browser is closed and the output.txt file is deleted. The only why I can stop it is to delete the cgi script itself!
I am perfectly happy with taking an entirly differant approach if anyone knows of one. Or if you can tell me why my scripts are not working, that would be great too.
Thanks in advance for any insight.