Jump to content

Updating a file help


Imad

Recommended Posts

Hi guys,

 

I have a settings.php file that I want to be able to update using a text form. However, when I update one setting within the file I want it to keep the other settings within the file and not remove everything in the file except for the setting I updated.

 

How can I do so?

Best Regards.

Link to comment
https://forums.phpfreaks.com/topic/124690-updating-a-file-help/
Share on other sites

Read the entire file into a string, update the particular value in that string, write the whole string back to the blank file.

 

That's what I was thinking of doing, or do something like hidden textbox fields that contains the information. But I thought maybe someone would have an easier way around it.

Best Regards.

Link to comment
https://forums.phpfreaks.com/topic/124690-updating-a-file-help/#findComment-644071
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.