PHP Classes

read and write ini file: Create a web page that manages a .ini file

Recommend this page to a friend!
  All requests RSS feed  >  read and write ini file  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

read and write ini file

Edit

Picture of Marco Mariani by Marco Mariani - 6 years ago (2015-05-22)

Create a web page that manages a .ini file

This request is clear and relevant.
This request is not clear or is not relevant.

+1

I need to create a simple Web page that prints a .ini file. I also need to modify the .ini file in the Web page using a save button.

  • 1 Clarification request
  • 1. Picture of Gerry Danen by Gerry Danen - 6 years ago (2015-05-22) Reply

    Based on discussion, you are likely looking for a forms manager to deal with putting values from an ini in fields and retrieving the user input, rather than a .ini file manager.

    Is that correct?

    • 2. Picture of Marco Mariani by Marco Mariani - 6 years ago (2015-05-26) in reply to comment 1 by Gerry Danen Comment

      yes I need this: put the vaulues of a .ini files into a table in a webpage and then I need to modify the values in the webpage and save the values with a save button (in the webpage) into the .ini file. But I don't understand how to create an interface that works with the php code (for example the raccomanded package!).

      Any advice? I need something as soon as possible!

      Thanks a lot for the support! You are all very kind!!! ;)

    • 3. Picture of Pierre Delporte by Pierre Delporte - 6 years ago (2015-05-27) in reply to comment 2 by Marco Mariani Comment

      Why not simply use "parse_ini_file" from PHP itsel ?

    • 4. Picture of Pierre Delporte by Pierre Delporte - 6 years ago (2015-05-27) in reply to comment 3 by Pierre Delporte Comment

      and of course, I forgot to mention it "write_ini_file" to save back.

    • 5. Picture of Marco Mariani by Marco Mariani - 6 years ago (2015-05-27) in reply to comment 4 by Pierre Delporte Comment

      where i need use that? in the html page or in the php page? Because I'm using an html page with the interface in where is included the php page that do the work!!!!

      thanks

      Can you put a raccomandation?

    • 6. Picture of Pierre Delporte by Pierre Delporte - 6 years ago (2015-05-27) in reply to comment 5 by Marco Mariani Comment

      This should go into the php page that do the work. Now it is difficult to tell you how, as everything is not clear. Can you send the whole thing so we could have a look, or send an url where we could better try to understand your problem ?

Ask clarification

2 Recommendations

PHP INI Editor Class: View and edit INI files in Web forms

This recommendation solves the problem.
This recommendation does not solve the problem.

0

Picture of Blupixel IT Srl by Blupixel IT Srl package author package author Reputation 25 - 5 years ago (2017-01-24) Comment

This class do exactly what you need in few lines of code.


Simple Files: Read, add, modify and delete lines from text files

This recommendation solves the problem.
This recommendation does not solve the problem.

+1

Picture of Dave Smith by Dave Smith Reputation 6845 - 6 years ago (2015-05-22) Comment

I would give this one a try, it uses grep like features in case you want to only present and change particular lines. You will need to design the interface, however this class should be able to do the work you need.

  • 5 Comments
  • 1. Picture of Marco Mariani by Marco Mariani - 6 years ago (2015-05-22) Reply

    thanks I'll try, but now I'm thinking anathor way... create a db with a management page with a button that give this function...

    mysql> SELECT * FROM print_tbl

    -> INTO OUTFILE '/tmp/print.ini';
    

    do you think it is a good idea?

    thank a lot for the support!

  • 2. Picture of Gerry Danen by Gerry Danen - 6 years ago (2015-05-22) in reply to comment 1 by Marco Mariani Reply

    How do you plan to get the .ini file back into the db table?

  • 3. Picture of Marco Mariani by Marco Mariani - 6 years ago (2015-05-22) in reply to comment 2 by Gerry Danen Reply

    any advice? :)

  • 4. Picture of Gerry Danen by Gerry Danen - 6 years ago (2015-05-22) in reply to comment 3 by Marco Mariani Reply

    If you have a DB table, you don't need an ini file. Just maintain the DB table.

    If you DO want the ini file, don't use a DB table. That makes it unnecessarily complex.

  • 5. Picture of Marco Mariani by Marco Mariani - 6 years ago (2015-05-22) in reply to comment 4 by Gerry Danen Reply

    ok but I've used php only for websites... create a php program also with the beautiful code in this website it's too diffucult for me, I need something with an interface!!! advice?

    thanks a lot


Recommend package
: 
: 
For more information send a message to info at phpclasses dot org.