How to display html result from a textarea |
How to display html result from a textarea |
The_webmaster |
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
|
Christian J |
Feb 26 2021, 08:03 AM
Post
#2
|
. Group: WDG Moderators Posts: 9,722 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 |
The_webmaster |
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
|
Lo-Fi Version | Time is now: 25th September 2024 - 05:49 AM |