How to pass data from JS to PHP for a plugin #3753
Unanswered
SachinSAgrawal
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I made a plugin that runs some javascript to get info about the device the code is run on (such as battery, screen size, etc) that I then save to a cookie which can be read the next time the user visits the site. However, that is not great because I want the most accurate information, and the next time the user visits the site if at all, that information could be different. How do I pass the information from the javascript back to the PHP? I tried making a form and then checking if the post is set, but it doesn't work
Here is my code:
And yes, I may have "hacked" a core file, so if you know how I can instead do this with a plugin, please let me know. Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions