Updating SQL Db with Client-Side Information

liunx

Guest
Does anyone have any ideas as to how I could update a table in my SQL database with information gathered through javascript on a page?

My issuse:
I want to build a table with user_id and screen_resolution. I want a javascript to run when someone hits the page to get the screen resolution, and for the resolution to be stored in a table.

Any ideas?One way would be to nest a form with hidden fields on the page. Using Javascript you would populate the fields of the hidden from and then
form.submit() it back to your server. However be carefull that your server side code does that handles this form post does NOT return any response.

Alternatively a simpler method would be to have your javascript make a requst to a serverside code page with a parameterised URL

For example

<!-- m --><a class="postlink" href="http://www.mydomain.com/statistics.aspx?screenx=800&screeny=600&something=somevalue">http://www.mydomain.com/statistics.aspx ... =somevalue</a><!-- m -->

Good luck

Tikiri

Web application development (<!-- m --><a class="postlink" href="http://www.zapstrategy.com">http://www.zapstrategy.com</a><!-- m -->)
 
Back
Top