Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get html text to upload to a database #83

Closed
RubenRDC opened this issue Oct 27, 2022 · 6 comments
Closed

Get html text to upload to a database #83

RubenRDC opened this issue Oct 27, 2022 · 6 comments

Comments

@RubenRDC
Copy link

I wanted to see how to access the text entered in the textarea and then upload it to a database... another thing... can writing scripts and PHP code be blocked in the textarea?

@webfashionist
Copy link
Owner

Hi @RubenRDC

The RichText field works as any other textarea in your form and can simply be accessed via PHP as the other fields. Not sure how I can assist you without knowing your code base.

Blocking scripts should be done via PHP to actually prevent it from being saved even if Frontend code has been manipulated.

@RubenRDC
Copy link
Author

I have tried to access the textarea with php through a form by putting an id in the plugin configuration but PHP throws the id I am trying to access null

@webfashionist
Copy link
Owner

webfashionist commented Oct 27, 2022

PHP does not access any input fields by its ID, but by the name attribute.

So you'll need to add a name attribute to your initial textarea field.

@RubenRDC
Copy link
Author

I'm not very familiar with PHP, I was wondering if you could give me an example, anyway the problem I have is that when I put any script in the text area, it runs instantly

@RubenRDC
Copy link
Author

RubenRDC commented Nov 6, 2022

Hello, would you not give me an example of how to obtain the content of the Richtext and filter it? please

@webfashionist
Copy link
Owner

The RichText field can simply be used within a <form> and submitting it, sends the input value to the backend.
Not having any insights in your code makes it impossible to solve the issues you have and additionally would go way beyond this open source project.

You can however also get access to my freelance web developer services, if you wish so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants