Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6866251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:09:34+00:00 2026-05-27T03:09:34+00:00

I have developed a site for a client and he wants to be able

  • 0

I have developed a site for a client and he wants to be able to edit a small part of the main page in a backend type of solution. So as a solution, I want to add a very basic editor (domain.com/backend/editor.php) that when you visit it, it will have a textfield with the code and a save button. The code that it will edit will be set to a TXT file.

I would presume that such thing would be easy to code in PHP but google didn’t assist me this time so I am hoping that there might be someone here that would point me to the right direction. Note that I have no experience in PHP programming, only HTML and basic javascript so please be thorough in any reply that you provide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:09:35+00:00Added an answer on May 27, 2026 at 3:09 am

    You create a HTML form to edit the text-file’s content. In case it get’s submitted, you update the text-file (and redirect to the form again to prevent F5/Refresh warnings):

    <?php
    
    // configuration
    $url = 'http://example.com/backend/editor.php';
    $file = '/path/to/txt/file';
    
    // check if form has been submitted
    if (isset($_POST['text']))
    {
        // save the text contents
        file_put_contents($file, $_POST['text']);
    
        // redirect to form again
        header(sprintf('Location: %s', $url));
        printf('<a href="%s">Moved</a>.', htmlspecialchars($url));
        exit();
    }
    
    // read the textfile
    $text = file_get_contents($file);
    
    ?>
    <!-- HTML form -->
    <form action="" method="post">
    <textarea name="text"><?php echo htmlspecialchars((string)$text); ?></textarea>
    <input type="submit" />
    <input type="reset" />
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, I have developed a small site that i would like to embed
Hey guys, I have a client who wants their front site to have a
I have developed a site with ASP.NET MVC 1, and now I'm trying to
I have developed a site, which has some static pages. Like explore, home, feedback.
I have uploaded one site developed with codeigniter. and after applying the .htaccess, it
I have a web site already developed with tons of updatePanels, buttons, and integrated
I have a site that I've developed that makes decent use of Javascript, and
I have a asp.net web site that was developed on the .Net Framework v2
I have a client who has a fancy facebook page and it looking to
I am doing some updates to a site I have developed over the last

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.