I need to get the javascript variable document.body.clientWidth passed into a php variabel. I know how to do this in form, refreshing page or cookies, BUT I need that the browser find it onload.
So when the user enters the page I will automaticly get their brower width into php so I can use it in forinstance <form width=$var> and some special php functions I'm making.
One thing I tryed to do was to use this code in php and then try and assign the print "document.write(document.body.clientWidth)\n"; into a php variable, but that doesnt seem to work.
/
print "<script type=\"text/javascript\">\n";
print "<!--\n";
print "document.write(document.body.clientWidth)\n";
print "-->\n";
print "</script>\n";
/
Did anyone understand my problem? 🙂
Thanks
aCa