Here is a PHP script that will allow you to do all of this and more:
http://phpsysinfo.sourceforge.net/[
^]
The key here, though, is that this will give you stats about the computer it is running on, not on a different computer. If you are attempting to access the data for another computer (besides the one that is hosting the PHP script), you need to choose a different language. PHP is a server-side scripting language. It doesn't have access to resources on other machines.