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

  • Home
  • SEARCH
  • 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 7088993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:52:07+00:00 2026-05-28T07:52:07+00:00

My website is allowing blogging , i use textarea for the blog post and

  • 0

My website is allowing blogging , i use textarea for the blog post and i need to allow the users to share things like youtube videos (i will need to allow iframe tag to do so) or display images using the img tag or using links by allowing the a tag , The problem is i need to secure the website against XXS attacks and that is why i am afraid to allow those tags, is there any work around to accomplish this ?

can i use something like this :

<?php
   $string = "<b>hello world!</b>";
   echo "without filtering:".$string;
   echo "<br>";
   $filtered = htmlspecialchars($string); // insert into database filtered
   echo "After filtering:".$filtered;
   echo "<br>";
   $de_filtering = htmlspecialchars_decode($filtered); //retrieve from database and display
   echo "After de-filtering:".$de_filtering;        
  ?>

is it possible to do that ?

  • 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-28T07:52:07+00:00Added an answer on May 28, 2026 at 7:52 am

    The freshly released HTMPurifier 4.4 adds a feature for doing exactly this.

    http://htmlpurifier.org/phorum/read.php?5,5319,5555#msg-5555

    In short, you should allow iframes that come from trusted domains. Iframes from untrusted domains could include malicious javascript/flash/embeds

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

Sidebar

Related Questions

I am developing a website, where I am allowing users to upload videos, but
I have a comics website where I'd like to allow users to vote once
I am allowing my users to post messages on my website. I want to
Website: http://videojs.com/ How can I use the YouTube Skin on the frontpage? I'd really
The example is a website allowing users (who are associated with Facebook users) to
So we were going to make a website allowing users to upload video. The
on my website I will be allowing users to insert text into multiple WYSIWYG(TinyMCE)
I am allowing users of the admin panel of my website to upload photos,
I'm developing a multilingual (EN/RU) website and I need a solution allowing me to
My website would like users to upload their photos...but how do I keep our

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.