473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Read Registry from PHP

pritipshah
Hello All,

I want to Access Registry from PHP script. I had sreach on net and I got Class for this which is as below.
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. class Registry {
  3.         private $vars = array();
  4.         function set($key, $var) {
  5.             if (isset($this->vars[$key]) == true) {
  6.                     throw new Exception('Unable to set var `' . $key . '`. Already set.');
  7.             }
  8.  
  9.             $this->vars[$key] = $var;
  10.             return true;
  11.         }
  12.  
  13.         function get($key) {
  14.                 if (isset($this->vars[$key]) == false) {
  15.                         return null;
  16.                 }
  17.  
  18.                 return $this->vars[$key];
  19.         }
  20.  
  21.         function remove($var) {
  22.                 unset($this->vars[$key]);
  23.         }
  24.  
  25.  
  26.         /*}*/
  27. }
  28.  
  29. $registry = new Registry;
  30.  
  31.  //Set some data
  32. //$registry->set ('name', 'Priti Shah');
  33.  
  34.  //Get data, using get()
  35. echo $registry->get ('name');
  36.  
  37.  //Get data, using array access
  38. echo $registry['name'];
  39.  
  40.  
  41.  
  42. ?>
But this will just set KEY to Array and read it from Array. I want to read KEY from regedit.

Please help me out soooon .........

Regards,
Sep 1 '07 #1
4 9672
You would need to open the files were the windows registry is stored Ntuser.dat and Usrclass.dat as I remember. Then you would need to write a class that could read the binary steam from windows registry and turn it into a php array.

I can't even point you in the right direction in order to find a place that would have documentation on how to decode those files. May be someone else here can.
Sep 1 '07 #2
Thank you,

But i can't event got what you say because i am very new for dealing with registry.so can you please explain me as simple as you can??? may be i can make some idea from that....

Or please anyone who know sonlution for this HELP ME OUT...

Regards,
Sep 1 '07 #3
pbmods
5,821 Expert 4TB
Heya, Pritipshah. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

You may need to use an external program and call it using exec().
Sep 1 '07 #4
I found this http://www.robvanderwoude.com/regedit.html earlier today. It might help you with console output aswell as what to send to
Expand|Select|Wrap|Line Numbers
  1. exec();
. I highly recommend against doing this as a security expert.
~
Brian W.
Sep 2 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: sriram pasham | last post by:
Hi Could any one tell me how to access(read) a registry key using javascript from a webpage(ASP page). Thanks in advance. Sriram *** Sent via Developersdex http://www.developersdex.com ***...
2
by: fabrice | last post by:
hello, Is it possible to read a registry key in ASP, and use the value in an application via a session variable. I'm using II6 on windows server 2003. I'd like to create a key in the registry...
6
by: George Hester | last post by:
This location has a parasite checker using javascript. It is in a js file called parasite.js. It is freely available. http://www.doxdesk.com/parasite/ He\She is the only one I trust on the...
2
by: Dan Sikorsky | last post by:
Should application data be read and written to the Registry to persist state, or should the App.config file be used? If the Registry should be used, what .NET class reads and writes the...
8
by: Fred | last post by:
Hello, Is there a way to read values from the registry as regular instead of verbatim? Regards, Fred
3
by: Slimo | last post by:
Hello, I'm searching some example of code (VB) for reading remote registry subkeys and keys. Thanks
4
by: akhare1 | last post by:
OK, before I start, let me clarify a few things here. This is not the run of the mill failure to read a registry key while trying to write to the Event Log. Here's our setup: a) IIS 6.0...
2
by: Henry Fleming | last post by:
I have an C# assembly that is supposed to read a registry key: RegistryKey regCurrentUser = Registry.CurrentUser; RegistryKey regSoftware = regCurrentUser.OpenSubKey("Software",true);...
2
by: michael.cizmar | last post by:
What rights do I need to assign to the asp.net account in order for it to be able to read some settings from the registry. These settings are not for my able but have information about another...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.