Link to home
Start Free TrialLog in
Avatar of Wizard_IT
Wizard_ITFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Windows Environment Variable Extraction to HTML / WEB

We are making a simple HTML website.
We need to extract Windows Environment variables (Ie the ones set is Computer - Properties)
The variable we have set at dos level is called storename
We would also like to retrieve the IP Address and Default gateway of the PC
If we need to store these in environment variables too we will
Thanks in advance
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Do you want the CLIENT's computer name/IP address/gateway or the SERVER's computer name/IP address/gateway.

If it is the client's you want, then you will have to either ask them very nicely to enter it into a form or construct a java or activex app to get them (and there may be limits as to what you can get hold of).

Client side JS cannot access this info.

ASKER CERTIFIED SOLUTION
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The php solution can be easily adapted to any decent scripting language, but this still wouldn't give you CLIENT details, just server details.
Avatar of Wizard_IT

ASKER

Thanks qualding!!!
I uploaded a test page online containing the script you suggested and when browsing to the page i receive the following:
"Warning: exec() has been disabled for security reasons in /home/jay/public_html/index.php on line 13

Warning: Invalid argument supplied for foreach() in /home/jay/public_html/index.php on line 14
The storename is undefined The IP Address is The Default Gateway is "

the url of the page is "unusualsuspex.wmn.cc/index.php" if you want to take a look at source code
please help, i really need to get this working for monday!
Thanks in advance.
The first error of "Warning: exec() has been disabled for security reasons in /home/jay/public_html/index.php on line 1", means that your ISP has disabled the ability for you to run external applications. Even such things as ipconfig.

This is a security setting made by the ISP and as such there is no work around using PHP. You could try using Perl (no idea what to code), but I suspect Perl has a similar mechanism on restrictions.