Forum Moderators: coopster

Message Too Old, No Replies

How to Read a File, Edit and Replace that file with new Changes?

         

robohelp

11:03 am on Aug 31, 2006 (gmt 0)

10+ Year Member



Hi

I am making a enhancement to our helpdesk product. So we are using JSON for saving the Language defaults. Now I am Using PHP as a server based language. Now here is the logic of the program. Whenever our product is installed then a parser will create a HTML file which will have all the defaults from the JSON file. Now when a user changes the language then the parser will again Run and make the required changes in the JSON file and again create the HTML file and Replace it in that folder. I am not able to find a good solution for this.

Can someone help me building it. I am not able to get how to Open a file, Read it, make the changes and Replace that file. I hope someone can help me in this regard.

Thanks

Lalit

barns101

11:05 am on Aug 31, 2006 (gmt 0)

10+ Year Member



Take a look at fopen() [php.net].

robohelp

11:07 am on Aug 31, 2006 (gmt 0)

10+ Year Member



But that doesn't solve my problem....i need some parser or something which does that.....:(

henry0

11:17 am on Aug 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



robohelp welcome to WebmasterWorld!

This is not clear in my mind

Whenever our product is installed then a parser will create a HTML file which will have all the defaults from the JSON file. Now when a user changes the language then the parser will again Run and make the required changes in the JSON file and again create the HTML file and Replace it in that folder

is the above the result of actual scripts action
or some new performance expectations?

if it does create a new file
you are getting the results of a sort of CMS so it seems to be fine
what could be better than updating as expected
or I do not get the object of your quest :)