Ask, CI framework embedded Baidu Editor, how to get editor content

Source: Internet
Author: User
The system has a page, users need to fill in the text information, I put Baidu editor embedded in, but do not know how to get the content to write, and then submit. Generate PHP files.

Now I do not know how this editor is submitted by the form, itself this does not take a form, checked the information did not get out.

Thank you


Two questions,
1. How to get the content that the editor fills in.
2. The editor fills in the content to generate the PHP file


Reply to discussion (solution)

Add the Name property directly to the editor's textarea or script tag, just like normal textarea



 
  


This is my previous, not very will add, consult, thank you

ID Myeditor Why do you have 2, remove the div?
You can see the script var_dump ($_post) after submission.



Out, if you want to get the editor of the source code (HTML source), how to deal with AH? Thank you

In order to later generate the HTML source PHP file

$_post[' Myeditor ' is the HTML code in the editor.

$_post[' Myeditor ' is the HTML code in the editor.



No, it is written in plain text. Text similar to form submission

Baidu Editor itself has a
Editor.getcontent () This function, which can be obtained, but does not know which block to add it to now

What, you text box of name= "Myeditor", backstage use this to get AH

$this->input->post (' myeditor '));



Above can be obtained, but not source code

I want to get


Content of XX written



Tagged source code



Above can be obtained, but not source code

I want to get


Content of XX written



Tagged source code



I turned the previous write, it is really just use this can get HTML source code.
You are not submitting the string is filtered



Above can be obtained, but not source code

I want to get


Content of XX written



Tagged source code


What you get is content with HTML tags!
Only if you echo it, what you see on the browser is the formatted content. Because HTML is always interpreted by the browser
You can view the source code or output with a pre-formatted label

This backstage template looks good.


Add pre-formatted labels when outputting




Is there a function that can directly output HTML tags together? I remember one of those.

Public Function content () {

$content = $_post[' myeditor ');;
echo "--------------------------". "
";
echo Htmlspecialchars ($content);
Echo $content;
}

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.