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 6139501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:59:52+00:00 2026-05-23T17:59:52+00:00

I want a WYSIWYG html editor to create a static web page. After some

  • 0

I want a WYSIWYG html editor to create a static web page. After some looking around, I downloaded and installed TinyMCE on my server, following the instructions at moxiecode. The problem is that there’s a major disconnect between what moxiecode considers to be a “dummy”, and what I consider to be a “dummy”.

I’ve installed to the point where I can browse to the configuration page and see the editor window, and type into the editor window. The problem is that I can’t actually save the code to anywhere where it generates something that I can view on a browser. Any filling in of the dots gratefully appreciated.

The textarea that I’m editing looks like this:

<form method="post" action="../index.php">
<p>     
<textarea name="content" cols="50" rows="15">foo</textarea>
<input type="submit" value="Save" />
</p>
</form>

And ‘../index.php’ (in the site root directory) looks like this:

<?php
echo(stripslashes($_POST['content']));
?>

What I’m hoping is that when I click the ‘save’ button, I’ll be able to browse to the root of the website, and the browser will magically pick up index.php, which somehow displays ‘foo’. Of course, this doesn’t work. How is it meant to work? What happens when I click ‘save’, and how do I actually see the results anywhere?

What actually happens when I click save is that the editor window now displays what it says is ‘index.php’, with ‘foo’ in it. I have to click the back button to get back to the editor window. I guess this is what’s meant to happen, although it doesn’t happen when I use TinyMCE in Joomla – when you click save, you still see the editor window. However, the problem is that I can’t actually see the content in any other browser window. If I browse to the website root, or explicitly to root/index.php, I just see a blank page. If I open up 2 tabs on the browser, they can show exactly the same address (ie. 192.168.1.104/root/index.php), but the editor one displays ‘foo’, and the other one shows a blank page.

Thanks –

Al


Edit: version of Wesley’s code which is sufficient to use TinyMCE as an editor which creates a file called index.html:

<?php
$str = <<<EOD
<html>
<head><title>Hello World</title></head>
<body>
EOD;
file_put_contents('../index.html', $str);
file_put_contents('../index.html', $_POST['content'], FILE_APPEND);
file_put_contents('../index.html', '</body></html>', FILE_APPEND);
header('Location: ../index.html');
?>
  • 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-23T17:59:52+00:00Added an answer on May 23, 2026 at 5:59 pm

    The fundamental problem here is that you are not actually saving the data anywhere, you’re only printing your input when you post to index.php. $_POST data only persists for the duration of the request, it does not stick around for another – and is unique to you. Others cannot see your post data.

    If you are trying to edit a web page, you need to do something with the $_POST data. You can save it by creating or modifying a file with PHP, or you can save it to a database. Then, when you want to see the page, you have to get the content from the database or file. You can even modify and create HTML files, but you have to do it with PHP.

    There are lots of ways to do it. Here’s a very brief example: Have your form post somewhere else, to a file called edit-page.php for example, and have the contents of that file do something like this:

    file_put_contents('index.html', $_POST['content']);
    header('Location: index.html');
    

    This will take $_POST['content'] and write it to a file called index.html, then redirect you there to view it (although of course it will not be a complete document, only what you posted).

    Of course you will need a doctype, <head>, ways to handle errors, etc… So this is not really what you should do. This is not intended to be a tutorial, just a nudge in a hopefully useful direction.

    Bottom line is that you need to write the data somewhere permanently, then retrieve it from that source to view it. You can use includes to handle partial html pages and piece them together for example, if you want to go the file writing route while you’re still learning.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I want is to insert TinyMce wysiwyg editor onto frontend. Currently what I
I want to know the basic principle used for WYSIWYG pages on the web.
I want to write a very simple WYSIWYG editor, but i don't understand how
I want to create a java application that allows users to import a web
I installed the WYSIWYG module on my Drupal 6 site, and I'm using TinyMCE.
I'm having a hard time finding a good WYSIWYG editor, tried CKeditor & TinyMCE
I have a WYSIWYG editor on one of my forms and I want to
Im using Drupal with the WYSIWYG module. I want the CSS in my editor
I am currently using the control System.Windows.Forms.WebBrowser to create an Wysiwyg editor in a
Using PHP I'm attempting to take an HTML string passed from a WYSIWYG editor

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.