Open/Load/View HTML file in TEXTAREA and update using PHP

What we are doing here is ‘edit an HTML on the user side’.

For example,

I have a file called manual.html. I have uploaded that file on CPANEL and only I have the accessing the CPANEL.


If someone wants to make changes in the manual, what would he/she do?They would need to ask me every time to make changes or will give me the new/changed file and tell me to upload it on the server.

There is an easy way out…

Let’s just give them an option of editing the HTML file on the server and click on SAVE/UPDATE button and save the file directly to the server.

Sounds cool right?

All you need to do is create 2 files:

  1. edit_manual.php
  2. editcontents.php

For editing the HTML file we will use html CKEDITOR.

1. Create a file called edit_manual.php
Put the following code inside it.[Copy the following code and paste it in your file ]


<script src="//"></script>
<form action="editcontents.php" method="POST">
<table align="center" >
<td><textarea name="text_id" id="t_id"  rows=7 cols=17 value="<?php echo "MANUAL.html" ?>">
include "MANUAL.html";
// Replace the <textarea id="t_id"> with a CKEditor
// instance, using default configuration.

CKEDITOR.replace( 't_id' );
CKEDITOR.config.autoParagraph = false;
CKEDITOR.config.fillEmptyBlocks = false;
CKEDITOR.config.allowedContent = true;
CKEDITOR.config.forcePasteAsPlainText = true;
<td><input type="submit" value="Update" name="edit" /></td>


2. Create file editcontents.php
Put the following code inside it.[Copy the following code and paste it in your file ]
$handle = fopen("MANUAL.html", "w") or die("Unable to open file!");
$text  = $_POST['text_id'];
if(fwrite($handle, $text) == FALSE){
  echo '<span class="redtxt">There was an error</span>';
   echo '<span class="redtxt">File edited successfully</span>';
echo '<a href="path/to/MANUAL.html" target="new">CLICK HERE TO VIEW THE FILE</a>';
<button onclick="goBack()">Go Back</button>
function goBack() {
Below given is the image of how the output should look like:[html file opened in text area]

175 thoughts on “Open/Load/View HTML file in TEXTAREA and update using PHP

  1. Pingback: url
  2. Pingback: vape eliquid
  3. Pingback: site Blog Name
  4. Pingback: WOW Site Blog Name
  5. Pingback: article
  6. Pingback: article
  7. Pingback: article
  8. Pingback: xxxpics xyz
  9. Pingback: xxlph xyz
  10. Pingback: pornph xyz
  11. Pingback: xxxph top
  12. Pingback: article
  13. Pingback: xyz
  14. Pingback: adulthq top
  15. Pingback: article
  16. Pingback: xnxxhd top
  17. Pingback: xxxhq top
  18. Pingback: article
  19. Pingback: xxlhd xyz
  20. Pingback: adultpics top
  21. Pingback: article
  22. Pingback: xxxph xyz
  23. Pingback: article
  24. Pingback: article
  25. Pingback: article
  26. Pingback: xxlhq xyz
  27. Pingback: xxlph top
  28. Pingback: article
  29. Pingback: adultph top
  30. Pingback: xxlhq top
  31. Pingback: adulthd top
  32. Pingback: adulthd xyz
  33. Pingback: pornph top
  34. Pingback: adulthq xyz
  35. Pingback: article
  36. Pingback: czyszczenie strony
  37. Pingback: IDLE
  38. Pingback: biquinis online
  39. Pingback: CCTV
  40. Pingback: Wooden Knife
  41. Pingback: Beitragsabrechnung
  42. Pingback: kona coffee store
  43. Pingback: kona coffee brands
  44. Pingback: pure kona coffee
  45. Pingback: kona coffee
  46. Pingback: kona coffee beans
  47. Pingback: 100% kona coffee
  48. Pingback: 100% kona coffee
  49. Pingback: Joomla extensions
  50. Pingback: screen repair
  51. Pingback: free pink noise
  52. Pingback: travel bag
  53. Pingback: machine learning
  54. Pingback: marketing digital
  55. Pingback: agente aduanal
  56. Pingback: dog boarding
  57. Pingback: good omens
  58. Pingback: eyeglasses
  59. Pingback: data logger
  60. Pingback: forex strategies
  61. Pingback: Affordable movers
  62. Pingback: seo services
  63. Pingback: 薬の通販
  64. Pingback: Cancun
  65. Pingback: kona beans
  66. Pingback: kona bean
  67. Pingback: Fashion Week
  68. Pingback: Art Hearts Fashion
  69. Pingback: hotels
  70. Pingback: money for college
  71. Pingback: food delivery
  72. Pingback: afiliado
  73. Pingback: bad credit loans
  74. Pingback: NBA
  75. Pingback: Clean Clothes
  76. Pingback: Cosplay Wigs
  77. Pingback: kona coffee beans
  78. Pingback: pure kona coffee
  79. Pingback: Remodeling
  80. Pingback: growth mindset
  81. Pingback: electrician
  82. Pingback: cat sunglasses
  83. Pingback: Custom Pmags
  84. Pingback: @iamgto
  85. Pingback: geologyrocks
  86. Pingback:
  87. Pingback: hs;br
  88. Pingback: tureckie_serialy
  89. Pingback:
  90. Pingback: +1+
  91. Pingback: watch
  92. Pingback: Application Server
  93. Pingback: ++++++
  94. Pingback: HD-720
  95. Pingback: 2020
  96. Pingback: Video
  97. Pingback:
  98. Pingback: sportovní legíny
  99. Pingback: Handmade jewelry
  100. Pingback: home improvement
  101. Pingback: לקנות
  102. Pingback: epoxy repairs
  103. Pingback: Exchange
  104. Pingback: Eviction help

Leave a Reply