Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1102931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:15:46+00:00 2026-05-17T01:15:46+00:00

I have a comment form on my website which, at the moment I filter

  • 0

I have a comment form on my website which, at the moment I filter out all html and turn it into plain text and also replace bad words with funny words. I want to be able to allow users to post images. I couldn’t see how to incorporate this to the comment page so have set it up on a separate page just dedicated to users posting images. But, I still don’t want to allow any other html except img. Also, protect from sql injection.

Does anyone have any ideas?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:15:47+00:00Added an answer on May 17, 2026 at 1:15 am

    Two decent methods would be using Tidy or HTMLPurifier. Both filter HTML very well and are highly customizable to suit your needs.

    With purifier (I speak from experience as I have used it) it will allow you to add something like:

    img[src,alt,title] 
    

    To the allowed tags property, which allows only those attributes in the img tag. See the website for more information / usages.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an element which displays a comment form, the action is comments/add. If
So I have this form which requests a JS call when a comment is
Here is the haml for my form: 34 #new_comment 35 %strong Add Comment: 36
I am trying to create form that contains another model in rails. I have
I have django.middleware.csrf.CsrfViewMiddleware in settings.MIDDLEWARE_CLASSES and CSRF verification is working just fine for all
Recently I have been looking at jquery/javascript solutions to emulating the placeholder attribute, but
I have a comments section on my websites that uses jQuery to animate comments
I have created a function (see below) that calculates a 7.5% sales tax. Now
Okay, in my head this is somewhat complicated and I hope I can explain
OK so here is the deal I am using a plugin called stray quotes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.