Im building a mailing contact form for my site. Its PHP.
I want to know my visitors Screen Width and Height so Ive tried adding the Scripts to my $variable =; But Ive had no luck. Every email sends the variable as etc rather using the code to give me a result.
<head><style>
<?
$screenwidth = '<script type="text/javascript">document.write(screen.availWidth);</script>';
?>
</style></head>
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
if(isset($_POST['submit']))
{
$ipadd = $_SERVER['REMOTE_ADDR'];
$agent = $_SERVER['HTTP_USER_AGENT'];
$screen = "$screenwidth";
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$mobile = $_POST['mob'];
$address = $_POST['addr'];
$formcontent="$name \n$mobile \n$address \r\nMessage: $message \r\nBrowser: $agent \nIP: $ipadd \n $screen \r\n";
$recipient = "";
$subject = $_POST['subject'];
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "<h3>Thank You!</h3><h4>Expect a response within 24 hours</h4>";
}
?>
Not having any luck. Could someone let me know my error? Cheers