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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:56:25+00:00 2026-05-24T16:56:25+00:00

I am using mysql_real_escape_string to save content in my mySQL database. The content I

  • 0

I am using mysql_real_escape_string to save content in my mySQL database. The content I save is HTML through a form. I delete and re-upload the PHP file that writes in DB when I need it.

To display correctly my HTML input I use stripslashes()

In other case, when I insert it without mysql_real_escape_string, I do not use stripslashes() on the output.

What is your opinion? Does stripslashes affect performance badly ?

  • 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-24T16:56:26+00:00Added an answer on May 24, 2026 at 4:56 pm

    Do not use stripslashes(). It is utterly useless in terms of security, and there’s no added benefit. This practice came from the dark ages of “magic quotes”, a thing of the past that has been eliminated in the next PHP version.

    Instead, only filter input:

    • string: mysql_real_escape_string($data)
    • integers: (int)$data
    • floats: (float)$data
    • boolean: isset($data) && $data

    The output is a different matter. If you are storing HTML, you need to filter HTML against javascript.

    Edit: If you have to do stripslashes() for the output to look correctly, than most probably you have magic quotes turned on. Some CMS even made the grave mistake to do their own magic quotes (eg: WordPress). Always filter as I advised above, turn off magic quotes, and you should be fine.

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

Sidebar

Related Questions

(Using MySQL and PHP) I have a search form that will allow my users
In PHP, I am escaping characters before insert in a MySQL database using mysql_real_escape_string
I'm pulling content from a DB that has been sanitized using mysql_real_escape_string. Accordingly the
I am using mysql_real_escape_string function while inserting the data into MySQL database. I am
I have a website that written with php and using mysql, I want to
I'm using MySQL API's function mysql_real_escape_string() Based on the documentation, it escapes the following
I saved some data in the database using mysql_real_escape_string() so the single quotes are
In PHP, I know that mysql_real_escape is much safer than using addslashes . However,
When i am using mysql_real_escape_string on my unescaped strings the data in the database
i am using php and running sql queries on a mysql server. in order

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.