Updating a php file from another one?

Discussion in 'PHP' started by Josh-H, Aug 15, 2007.

  1. #1
    What I mean is say I make a form to set a few variables that I need saved in config.php how would I do this?

    For instance.

    In config.php it would be: $dbname = ""

    and when they go through the install it would need to set that as $dbname = "Form data"

    How would I do this please? +REP to helpers.
     
    Josh-H, Aug 15, 2007 IP
  2. ecentricNick

    ecentricNick Peon

    Messages:
    351
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    read up on the fopen, fclose, fread, fwrite, fget and fput functions at php.net...

    They are used to read and write files. There is nothing to stop you directly writing php files such as the config.php you mention.

    http://www.php.net/fopen
     
    ecentricNick, Aug 15, 2007 IP
  3. Josh-H

    Josh-H Active Member

    Messages:
    406
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    thank you.
     
    Josh-H, Aug 15, 2007 IP