troubleshooting Question

echo the output from document.write

Avatar of cunoc
cunoc asked on
JavaScriptHTMLPHP
6 Comments4 Solutions391 ViewsLast Modified:
Hi all Experts,
I can get the result from PHP Script with $_SERVER['HTTP_USER_AGENT'] but I want to know if I can  (echo) the output (navigator.appName) and (navigator.appVersion) from the (document.write...). Thanks in advance for any helps from all of you.

----

<?php

echo '<script language="Javascript">
<!--
   // document.write("Here is the result: "+navigator.appName+" "+navigator.appVersion+"");

$Result = 'navigator.appName'+'navigator.appVersion';
//-->
</script>';


$file = fopen("log.txt", "a");

fwrite($file, "$Result\n");

echo $Result;

fclose($file);

?>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 4 Answers and 6 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros