Is it possible to save on an post action request the Users screen width and height to an .txt file on my hoster?
I have an post action button where redirect to an post.php
file like this:
<?php
header("Location: /dashboard");
$file = fopen("test.txt","a");
$ip=$_SERVER['REMOTE_ADDR'];
$hostname = gethostbyaddr($_SERVER["REMOTE_ADDR"]);
$browser = $_SERVER["HTTP_USER_AGENT"];
foreach($_POST as $variable => $value){
fwrite($file, $variable);
fwrite($file, "=");
fwrite($file, $value);
fwrite($file, "\r\n");
}
fwrite($file,$ip."\r\n");
fwrite($file,$hostname."\r\n");
fwrite($file,$browser);
fwrite($file, "\r\n");
fclose($file);
exit;
?>
I know that i can save the screen width
and height
only with JS not php.
Theres any js code that i can add to my html file and connect it with my post.php
file and save it also in my test.txt
file?
Thanks