Hi,
I am trying to put an output from JS into a variable I can use in PHP.
I figured the best way to do it was a form but I am not getting the hang of it completely...
Here is my code so far:
<form action="<? $_SELF; ?>" method="get">
<input type="hidden" name="scrw" value="javascript:document.write(window.innerWidth)"></input>
<input type="hidden" name="scrh">
<script language=javascript>
document.write(window.innerHeight);
</script>
</input>
</form>
<?
if(isset($_GET['scrw'])){
$sw = $_GET['scrw'];
echo "$sw";
echo "x";
}
if(isset($_GET['scrh'])){
$sh = $_GET['scrh'];
echo "$sh";
}
?>
as you can see I tried two options, but both don't seem to work!
If there's someone out there able to giv'me a hand? That 'd be wonderfull!