Jump to content

Osram

Members
  • Posts

    28
  • Joined

  • Last visited

Everything posted by Osram

  1. Sorry, I don't quite understand what you mean. Is there something I can add to the Content-Disposition line?
  2. So how should one then intiate and make this dialog?
  3. I have made a Php program that downloads an Inno setup installation file for installing a program. However, if I for one or another reason want to make a new download of the same Inno setup installation file, the previous file will still be found in the Download folder. Each of the downloads get a number in parenthesis, setup(1), setup(2), setup(3) etc. However, I wondered if it is posible to erase the previous file in the same process as I download a new one, so that however many downloads I do, there will all the time only be one occurence of this file in the Download folder. The download code is as follows: $exe = "Inno script/Test_setup.exe"; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=\"Test_setup.exe\""); header("Content-Length: " . filesize($exe)); readfile($exe); Thanks in advance. Sincerely
  4. Ok. Thank you. Sincerely
  5. Ok, thanks. But one more thing: Is it then so that it's not possible to get any information about the client's system, like the Mac address or the PC name? I came across this code on the internet: $MAC = exec('getmac'); $MAC = strtok($MAC, ' '); echo "Mac address is $MAC"; I didn't get it to work. Again got the HTTP ERROR 500, while the the error_reporting didn't work neither.
  6. Ok, I understand. So there's no way to do this. Good to know. Thanks for your comments. Sincerely
  7. The client will enter information into a form and click ok. But it maybe doesn't help. But is there no way the php program could download an exe program to the clients PC that could read the registry and transfer the variable to a php variable?
  8. The code will be on the server of the host, and the client run it from a web-site they visit.
  9. I don't quite understand what you mean by that, as the PHP code can be hidden on the server. Can you explain some more?
  10. The client is running this php program.
  11. I went into https://www.php.net/manual and searched for it, and got the message that it doesn't exist. I got it from this web-site: https://www.sitepoint.com/access-the-windows-registry-from-php/ But at Stackoverflow: https://stackoverflow.com/questions/41800894/undefined-function-reg-open-key-in-php-7-0 I am told that I have to install win32std, but with no instruction how to do it.
  12. By the way, the error message for the second option: $keyhandle = reg_open_key('HKEY_LOCAL_MACHINE', 'Software\Microsoft\Cryptography\MachineGuid'); $value = reg_enum_value($keyhandle,1); echo $value; is the following: Fatal error: Uncaught Error: Call to undefined function reg_open_key() in /customers/f/d/7/dmusic.com/httpd.www/dhvnd/dhru/test.php:10 Stack trace: #0 {main} thrown in /customers/f/d/7/dmusic.com/httpd.www/dhvnd/dhru/test.php on line 10 and line 10 is $keyhandle = reg_open_key('HKEY_LOCAL_MACHINE', 'Software\Microsoft\Cryptography\MachineGuid');
  13. Ok, but thanks anyway. I understood a little more. Sincerely
  14. No, I don't have anything else than just the script I've shown you. No class using require or include or any com file.
  15. Line 6 is $Wshshell= new COM('WScript.Shell'); I also now see that when I don't use the error reporting code, I get the message HTTP ERROR 500. Sorry, I overlooked it.
  16. After inserting the error reporting code, I got the following message: Fatal error: Uncaught Error: Class 'COM' not found in /customers/f/d/7/dmusic.com/httpd.www/dhvnd/dhru/test.php:6 Stack trace: #0 {main} thrown in /customers/f/d/7/dmusic.com/httpd.www/dhvnd/dhru/test.php on line 6
  17. I am not using any special IDE for editing php code. It's very seldom that I do programming in PHP. But it's maybe a good idea to get such a program anyway. As it is now, I only get the message that the page doesn't work.
  18. I am making some kind of licensing system and want to read a key value from the registry that identifies the PC of the client. I found some code on the internett, but which doesn't work, and I was hoping someone could explain me why. I want to read the key from the following address: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid. I am fully aware that this value can be changed, but I can use it anyway. I have found two methods. The first is the following: $Wshshell= new COM('WScript.Shell'); $data= $Wshshell->regRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGuid'); echo $data; And this is the second one: $keyhandle = reg_open_key('HKEY_LOCAL_MACHINE', 'Software\Microsoft\Cryptography\MachineGuid'); $value = reg_enum_value($keyhandle,1); echo $value; What am I missing to make these work, or are there other way to do it? Thanks in advance. Sincerely
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.