Jump to content

Recommended Posts

What would be the best way to send JavaScript variables to a database?

 

My guess would be that I would have to some how pass the values off to PHP... Right?

 

What is going to happen, is that some user takes a code I give them, then JavaScript will get some values such as screen resolution and small things like that... Screen resolution can only be gotten with JavaScript, and once it has been gotten, it needs to send the values back to my server, to save into a database... So... how is this done?

Link to comment
https://forums.phpfreaks.com/topic/75437-javascript-save-values/
Share on other sites

a few ways.  A hidden input variable sending via a form as normal in php.

Ajax (this uses js vars any way)

 

Yes screen res in php is an issue.  A lot of people will "flash" on first load of a site to get the screen res store it in a session or cookie to use on all other pages.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.