Page 1 of 1

Getting info about local machine

Posted: Thu Oct 30, 2003 10:25 am
by hibbeac1
Anyone know of any ways i can get info on the local machine such as memory used, CPU type etc. So i can display information like this on a web browser.

Already know how to get disk space, IP address and Operating System, just can't get the rest

Posted: Thu Oct 30, 2003 3:47 pm
by Fredix
In my opinion that is not possible because programms that show you the CPU, memory usage, for example are restricted to the root account.

I'm even wondering where you got the disc space from. 8O :?:

Posted: Thu Oct 30, 2003 4:55 pm
by Gen-ik
This can be done with JavaScript or VBscript..... not PHP because PHP is server-side. JS and VBS are client-side.

Posted: Sat Nov 01, 2003 7:04 am
by Fredix
Gen-ik wrote:This can be done with JavaScript or VBscript..... not PHP because PHP is server-side. JS and VBS are client-side.
Sorry I didn't note it was about the client but still I'm wondering about the disk space......

Posted: Sat Nov 01, 2003 11:46 am
by hibbeac1
You can get information on the hard disk (well only its storage) like this:-
$diskspacefree = round((disk_free_space("/") / 1073741824), 2);
$diskspacetotal = round((disk_total_space("/") / 1073741824), 2);

As for the using Javascript to get some more information i'll have to look into it. Unless anyone has any ideas.

Thanks for your replies.

Posted: Sat Nov 01, 2003 1:17 pm
by Gen-ik
Just out of curiosity why do you need all of this information about the users machine?

If it's for use on a website and the visitors find out your 'scanning' their machine like that then you're going to find your hit count dropping like a rock..... I for one wouldn't return to your site.


Anyway, other methods of guestimating the CPU speed and Connection speed are.....

CPU:
Create a Flash movie and time how long it takes to run through X amount of frames. While this doesn't give a precise CPU speed it will give you a rough idea of the users pocessing power. You'll need to use JS to record the time and get Flash to run an FScommand when it reaches frame X..... then do time/frames.

Connection Speed:
Again this is using Flash but instead of timing how long it takes to run through X amount of frames you will be checking how long it takes to load a Flash file. While this isn't an instant result due to the fact that the Flash file needs to load it will give you a good result. KBOfSWF / secondsTakenToLoad = X kb per second