read text file and Identyfy variable and. get form.. after want edit

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rangamdu
    New Member
    • Aug 2014
    • 2

    read text file and Identyfy variable and. get form.. after want edit

    my text file is data.txt..

    Code:
        # -------------------------------------------------
        SMTP_SERVER=Stemp.com
        SMTP_PORT=587
        SMTP_LOGIN=Rangamaddu.com
        SMTP_PWD= abc@123
        SMPT security type; Supported type: NO_SECURITY, USE_TLS, USE_SSL
        SMTP_SECURITY_TYPE=USE_TLS
    I want to EDIT this file using form... example...

    SMTP_SERVER get form filed and Semp.com must in text box..

    after if I change to Stemp.com as Setup.com. and update text file....

    please help me.. I don't want edit text field... edit.. I want each variable edit use form.. please.. I want php code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    I want php code
    Code:
    $str = '';
    foreach ($_POST as $key => $value) 
    {
        $str .= $key . '=' . $value . PHP_EOL;
    }
    file_put_contents('data.txt', $str);
    note: of course you need an appropriate form, but that wasn’t part of the question.

    Comment

    • rangamdu
      New Member
      • Aug 2014
      • 2

      #3
      Thank You.. so much.... I'll use that...

      Comment

      Working...