Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Location
    NY, NY
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Workstation Name

    I am working on an internal site that needs to grab the workstation name in a form that can be passed.

    Is this possible?
    I have it set up that x.js runs and the data comes up in a popup.
    I have no idea how to pass that data. Maybe I'm going down the wrong path.

    Pls help

    the x.js

    var WshNetwork = WScript.CreateObject("WScript.Network");
    WScript.echo ("Computer Name = " + WshNetwork.ComputerName);

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    well, it depends. what do you want to do with this information?

    by the way, this ought to be somewhere in the javascript forum.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Location
    NY, NY
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry wrong forum.


    I would like to get the info into a form that can be submitted into a sql database.

    thanks

  • #4
    Regular Coder
    Join Date
    May 2002
    Location
    London, England
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually, passing info would be in serverside, particularly MySQL forum or PHP

    Firstly, you are using WSH, (windows scripting host) which can pose a threat to most users, and might be switched off. I assume if you're getting computer name, then its over a corporate internet/intranet so i guess that's a little better

    TO do that, here's some code. It utilises PHP and a MySQL Database called info. THe code is fly-typed, so may contain a couple of errors!

    PHP Code:
    <?
    if(!$submit)
    {
    ?>
    <html>
    ..
    ..
    <form name="form" method="post" action="<?=$PHP_SELF?>">
    <input type="text" name="compname"> Computer Name
    <input type="submit" name="submit">
    </form>
    ..
    ..
    </html>
    <?
    }
    else
    {
    //submit to database
    //for this example we'l use database name "info" and table "user"

    //first we connect to database

    $connect mysql_connect('localhost','username','password');
    mysql_select_db("info",$connect);
    $result mysql_query("INSERT INTO user(compname) VALUES('$compname')");

    if(
    $result)
    {
    echo 
    "Submitted data. Thanks";
    }
    else
    {
    echo 
    "An error occured: ".mysql_error();
    }

    ?>
    Hope that sheds some light

    Jee
    Last edited by Jeewhizz; 06-13-2002 at 05:51 PM.
    Jeewhizz - MySQL Moderator
    http://www.sitehq.co.uk
    PHP and MySQL Hosting


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •