CMS: Save data in database with HTML tag in Joomla

CMS

As there are lots of editors are available to post content on web site, it also increase the chance of bad html to be inserted with data. Which may weird the look when loading on site. So to avoid this thing, Joomla by default filter all the HTML tag inserted from front end editors. But sometime we must need html tag coming from editor then we can use below code to give instruction to Joomla that don’t filter html tag for this particular variable only.

$post['description'] = JRequest::getVar('description', '', 'POST', 'string', JREQUEST_ALLOWHTML);

Here ‘description’ is field name comes from submitted form and which containing string with html tag. So here JREQUEST_ALLOWHTML will all html tags to be save in database.

Hope it helps…

Keep it up…
Coreway Solution 🙂

More resources like CMS
GET
100%

satisfaction
or
Get Your Money
Back

interested?

Let's Discuss Now

Just for you

pdf_icon_case

Download our WP checklist below and review your Wordpress site's performance today for free

DOWNLOAD