I've got it sending the user agent already:
<input type='hidden' name='user-agent' value='<?php echo $_SERVER['HTTP_USER_AGENT']; ?>'/><input type="submit" value="Send User Agent" />
I've done my research and there is some code out there that sadly doesn't work. It's other people with problems asking for help themselves.
How can I go about sending screen resolutions using php forms?
You will have to fill in the screen resolution via JavaScript and then send it. This is not a safe method, since anyone who wanted to could change the value in the hidden field... But it will work:
And simply use a couple of hidden fields:
you will not get the screen resolution from the server IMHO... you could let the form be rendered and then use javascript to update a form input with the correct information
HTML
and afterwards as a script
EDIT: added fiffle
The previous example should work:
Javascript
Are you getting any errors? Which browser are you using? OS?
As other people have said, the
screen
object works. Just saying "It doesn't work" doesn't help with finding the problem out. If you have jQuery correctly loaded, it will just work.This returns "1280x1024" in my case.
See http://jsfiddle.net/KVQM4/ for an example of it working. If you can create something similar to show how it doesn't work, or give us a bit more information as to the error.