mcerveni Posted April 5, 2009 Share Posted April 5, 2009 Anytime i put this: <script type="text/javascript"> var WshNetwork=new ActiveXObject("WScript.Network") var ca = WshNetwork.UserName; alert(ca); </script> the browser IE or firefox will give me this error: Error: ActiveXObject is not defined Source File: http://localhost/stats/index.php what I don't get is.. if I make a blank page and put that piece of javascript in the <head> section. it will work. For whatever reason, my site's i come up with once they're done - that active x code will not run lol... i neeed to figure out why. here is my header.php page .. <?php session_start(); ?> <html> <?php include('config.inc.php'); include('functions.inc.php'); ?> <head> <?php if(isset($_SESSION['logged_in'])) { ?> <title> Team Coach Center - <?php echo $_SESSION['tc_name'];?> </title> <?php } else { ?> <title> Team Coach Center </title> <?php } ?> <link rel="stylesheet" type="text/css" href="style/style.css"> <script type="text/javascript" src="scripts/func.js"> </script> <script type="text/javascript" src="scripts/mt1.1.js"> </script> </head> <body> <div id="dim"> </div> <div id="dimContent"> </div> <div id="check"> </div> Link to comment https://forums.phpfreaks.com/topic/152617-activexobject-not-definedhelp/ Share on other sites More sharing options...
Floydian Posted April 5, 2009 Share Posted April 5, 2009 I don't know why IE is choking on it, but only IE has ActiveX. So, it's pointless to target other browsers with ActiveX... Link to comment https://forums.phpfreaks.com/topic/152617-activexobject-not-definedhelp/#findComment-801544 Share on other sites More sharing options...
mcerveni Posted April 6, 2009 Author Share Posted April 6, 2009 Well, it's choking on it because it's not an HTML page. When i put that script in an html page, it will work. But in my php page, the ActiveXObject is not defined.. any suggestions? Link to comment https://forums.phpfreaks.com/topic/152617-activexobject-not-definedhelp/#findComment-802790 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.