473,663 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Read Registry from PHP

pritipshah
11 New Member
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 9685
Weisbartb
36 New Member
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
pritipshah
11 New Member
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 Recognized Expert Expert
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
Weisbartb
36 New Member
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
25205
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 *** Don't just participate in USENET...get rewarded for it!
2
8497
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 (under HKLM) and store a value (connection string for example). In the ASP application, read the value and store it in a session variable with global.asa.
6
5552
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 Net who has such a thing. But their js I believe cannot detect coolwebsearch parasites which are the most common such parasites on the Net today. So I'd like to incorporate a check for those parasites in the js. Any suggestions on how this can...
2
2469
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 Registry? If the App.config file should be used, reading a configuration setting is trivial, but there appears to be no write methtod. Please post a write method when replying. --
8
1782
by: Fred | last post by:
Hello, Is there a way to read values from the registry as regular instead of verbatim? Regards, Fred
3
3050
by: Slimo | last post by:
Hello, I'm searching some example of code (VB) for reading remote registry subkeys and keys. Thanks
4
2181
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 server w/ SharePoint installed b) ASP.NET application w/ NTLM authentication running under an account (application pool) with ADMIN privileges on the local box. c) We are NOT using impersonation
2
1960
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); RegistryKey regFamily = regSoftware.OpenSubKey("MyCompany", true); RegistryKey regApp = regFamily.OpenSubKey("MySystem", true); RegistryKey regSet = regApp.OpenSubKey("Set0", true); m_strDSN = (string) regSet.GetValue("DSN", m_strDSN); The string value...
2
3866
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 system which I am pulling data from. Thanks! Mike Cizmar
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6186
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1754
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.