0
In Client Browser ! Locally...
How can I create and save to a file . txt local on the client machine the value of two variables String .
This script is in the login and whenever the login is done this file is updated "overwritten" locally in the client’s machine passing updated values of these variables.
And then at another point in the script, read what’s in that file. txt "the value of the two variables previously entered and updated" and compare each of these values with two other variables in my script.
How can I accomplish this process ?
.TXT
$strGuarda01
$strGuarda02
$strCompara01 == $strGuarda01
$strCompara02 == $strGuarda02
You can’t. Your statement "my PHP runs on the client’s browser" is wrong. PHP is a language server-side and runs only on the server. What comes to the client is nothing more than the HTTP response created by PHP in conjunction with the web server. That is, you won’t be able to handle client-side files with PHP and it doesn’t even make much sense. What exactly do you want to do?
– Woss
can be using another type of method I thought this way, but I know that it runs on the server but I need to store and compare values locally on the client’s machine
– PauloMaia
And why does it need to be on file? What is this information? What do you want to do with it? What kind of check will it be? Store on cookies would not be enough?
– Woss
------> * I have a login system that receives data from a web service, but the user access the login while not connected to the internet, it is not possible to access the webservice in question, for this reason I intend to save in an external file for ex. in the windows registry of that same machine where the login system is installed PHP, save the value of 2 variables one is the serial number of the system that releases the entry to the system through login and another is a number that can vary from 0-99 .......... continue in the Prox. comment ...
– PauloMaia
which is a security number that I make available to the case of the user is without internet for a while the system goes discounting from this quota made available for off accesses and go decreasing this number in the register until arriving at a point where it has no exit because they ran-if the execution quotas off and it has to log in connected for the system to update the data saved in the windows registry
– PauloMaia
I need the full php Routine, I don’t have the . reg it needs to be created via php routine and written/stored in it the value of 2 variables and then in another routine search it and compare the values stored in it with the local variable controllers 2 to see if they are equal values................... It will be run in the client / String Text Data / I believe that in the Windows Registry it is safer because it is not lost and is well saved / in case It may be a Txt yes
– PauloMaia
@Anderson Carlos Woss It gave to understand ?
– PauloMaia
you would have to create a client application (that will make changes to the file/folder ) that communicates with your web application. I see as the best way to solve your problem
– teliz
@teliz Maybe ..... " socket" ordering your X service in X time, Another solution will be to use cookies or the browser’s own Localstorage in javascript //// Your idea is good but neither the ones I mentioned nor the one you mentioned can do and/ or create !
– PauloMaia
But as far as I know you can’t change a file using script in the browser. Eletron link can make this desktop application quickly, after it creates the API for it to communicate with your server. (sorry if it is being redundant)
– teliz
@teliz OK, however how to do ,,,,, I do not know ever did anything of the kind or the like ! can help me create and put to work ?
– PauloMaia
I’m a little jogged, but I can help you :)
– teliz
@teliz I Appreciate, how can we interact in this help ? right here ? or in chat ? or otherwise , Skype etc....
– PauloMaia
Can’t store this information with Javascript? with localStorage?
– usuario
@user | It can be any way as long as it works and help me create and by to work ! Grateful.
– PauloMaia
You use ajax in your login or direct in php?
– usuario
@usuario | Direct in php !
– PauloMaia
@teliz like this your photo, or how to identify you in skype appeared a lot .....
– PauloMaia