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 6929233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:17:28+00:00 2026-05-27T11:17:28+00:00

I recently started to use NicEdit on my Article Entry page. However, I have

  • 0

I recently started to use NicEdit on my “Article Entry” page. However, I have some questions about security and preventing abuse.

First question:
I currently sanitize every input with “mysql_real_escape_string()” in my database class. In addition, I sanitize HTML values with “htmlspecialchars(htmlentities(strip_tags($var))).

How would you sanitize your “HTML inputs” while adding them to database, or the way I’m doing it works perfect?

Second question:
While I was making this question, there was a question with “similar title” so I readed it once. It was someone speaking about “abused HTML inputs” to mess with his valid template. (e.g just input)

It may occur on my current system too. How should it be dealt with in PHP?

Ps. I want to keep using NicEdit, so using BBCode system should be the last advice.

Thank you.

  • 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-27T11:17:29+00:00Added an answer on May 27, 2026 at 11:17 am
    1. mysql_real_escape_string is not sanitization, it escapes text values to keep the syntax of the SQL query valid/unambiguous/injection safe.
    2. strip_tags is sanitizing your string.
    3. Doing both htmlentities and htmlspecialchars in order is overkill and may just garble your data. Since you’re also stripping tags right before that, it’s double overkill.
    4. The rule is to make sure your data doesn’t break your SQL syntax, therefore you mysql_real_escape_string once before putting the data into the query. You also do the same thing, protecting your HTML syntax, by HTML escaping text before outputting it into HTML, using either htmlspecialchars (recommended) or htmlentities, not both.
    5. For a much more in-depth excursion into all this read The Great Escapism (Or: What You Need To Know To Work With Text Within Text).
    6. I don’t know NicEdit, but I assume it allows your users to style text using HTML behind the scenes. Why are you stripping the HTML from the data then? There’s no point in using a WYSIWYG editor then.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently started to learn how to use openCL to speed up some part
I've recently started upgrading some applications to use Spring Webflow 2, and I want
I have recently started looking into Google Charts API for possible use within the
I have recently started to use Kohana and I know inheritance is in infancy
I've recently started looking at Merb, for use with some small projects around the
I have very recently started development on a multiplayer browser game that will use
So I just recently started learning about how databases work, how to use SQL
I have recently started to make useful use of C# extension methods. The SO
I have recently started reading up on Grails and would like to use SQL
I have recently started learning wpf and am trying to use mvvm. My understanding

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.