PDA

View Full Version : Getting Registry values


Raraken
01-13-2005, 02:28 AM
Is there a way you can get registry values from a computer though php?

firepages
01-13-2005, 03:32 AM
Not unless PHP is installed on the computer in question.

cfc
01-13-2005, 03:48 AM
I sincerely doubt that it's possible to access the windows registry in a server-side scripting language (or, for that matter, its client-side implementation) exclusively. You could copy portions of your registry (or the whole thing, for that matter) to a .reg or .txt file which PHP could read, but other than that it seems like tough luck without some help from another programming language.

I searched through the PHP and PHP-GTK docs and found nothing on accessing the windows registry, unsurprisingly enough.

firepages
01-13-2005, 04:18 AM
dude this is PHP , you should have more faith ;)

http://pecl.php.net/package/win32std

dniwebdesign
01-13-2005, 04:35 AM
What would be the point or an example that you would need to access the registry with PHP?

cfc
01-13-2005, 04:46 AM
*doh* I didn't even think to look at the PECL packages.

I can't see many uses for the package, but 1216 users have. I could understand using it if you were writing a PHP-GTK app and didn't want to use config files, but for portability (and not adding to the mess that tends to be the windows registry) reasons, I'd probably just end up using config files or object serialization (if PHP can use it) anyway.

Raraken
01-13-2005, 04:46 AM
dniwebdesign - -

Well, I'm working on an online game. Thing is though - I have limited bandwidth to work with.

After thinking, I decided that users can only access about 25 or so pages a day. But if they want to access more (I'm thinking about 100 pages a day - more than enough), They can install a small package of the layout images used on my site, and a few of the minor (but larger) flash components. I'm trying to think of way's to minimize the effort required to download and use the pictures. So far, I have an install program, and it will edit a reg value to say "Hey, I have the images! They are over in C:... ... ".

If I can't have php access the registry value for the game, then I'll need to have an extra page for the users to point to where the files are. This isnt a bad option, but less tech-savvy users might get confused and stop playing. I could use mySQL to say they have the images, but multiple computers would be a hassle, and using cookies would be an utter pain the the ### when users need to go though the process over and over.

If theres a better way to go about this - - feel free to voice it, I would be very interested. I'm unsure about macs and linux-based systems, because this may not be compatible.

Raraken
01-13-2005, 05:17 AM
I tried somthing diffrent.

I used a file_exists function on a random file in my C:\ directory, and it worked. I'm using ly laptop to do the testing on, will doing a file_exists function checking a personal computers C: drive work online?

raf
01-13-2005, 09:35 AM
Given the above quote
dude this is PHP , you should have more faith ;) i'am a bit hesitant, so to your question
will doing a file_exists function checking a personal computers C: drive work online?
i'll say: "no way".

i think you'll need an activex component for that.

firepages
01-13-2005, 11:01 AM
i'll say: "no way".
i think you'll need an activex component for that.

& I'll second that :D