The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to display html result from a textarea
The_webmaster
post Feb 25 2021, 11:40 AM
Post #1


Member
***

Group: Members
Posts: 40
Joined: 5-February 21
Member No.: 27,773



Please help me, i want to make a html code editor with a textarea for inputing html code and display its result as a working html. I also want php and other codes to work on the code editor. Thanks in advance
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Feb 26 2021, 08:03 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



That can be both simple and difficult to do. Will anybody on the web be allowed to use the editor? If not, you need some kind of password protection to keep unwanted people (or bots) out. You must also sanitize the input so that users don't break the page (intentionally or by accident) or post unwanted content on it.

To get form data with PHP, see https://www.php.net/manual/en/tutorial.forms.php

After sanitizing the form input (this is a topic all by itself), you can write it to an external text file with https://www.php.net/manual/en/function.file-put-contents.php --note that on on Apache servers, you may have to set the file permissions (CHMOD) of the file to writeable (this can be done in an FTP program).

To embed the text file's contents on a web page, see https://www.php.net/manual/en/function.file-get-contents.php

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
The_webmaster
post Feb 26 2021, 04:19 PM
Post #3


Member
***

Group: Members
Posts: 40
Joined: 5-February 21
Member No.: 27,773



The editor will be for everyone but don't worry i have gotten it. Thanks for your reply
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 29th March 2024 - 08:33 AM