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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:18:06+00:00 2026-06-15T03:18:06+00:00

Possible Duplicate: Does mysql_real_escape_string() FULLY protect against SQL injection? In my page I created

  • 0

Possible Duplicate:
Does mysql_real_escape_string() FULLY protect against SQL injection?

In my page I created a form and what I want to do is when posting the field value in php coding I want to use both the strip_tags and mysql_real_escap_string as :

$res = stript_tags(mysql_real_escape_string($_POST['name']));

Is the above coding correct for secure submission of input field names or it creates any problem when submission.

  • 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-06-15T03:18:08+00:00Added an answer on June 15, 2026 at 3:18 am

    In itself, this should work just fine. But personally, I’d advise you not to use mysql_real_escape_string at all. I believe I’m right in thinking you’re using the mysql_* extension, which is being deprecated. Do yourself a favour and switch to either PDO or mysqli_*, preferably PDO.

    These are more modern extensions, that support prepared statments
    see my answer here for a couple of links. Also, see Bobby tables on why prepared statements are a far safer bet than manually escaping data.

    As @phant0m says: use of mysql_real_escape_string isn’t full-proof (see the link in his comment). There’s also a couple of pitfalls when using functions like strip_tags and especially stripslashes: when you’re processing data, it’s not unimaginable that, at some point, the data contains something like Foo\'s Bar, and, as the docs say:

    If magic_quotes_sybase is on, no backslashes are stripped off but two apostrophes are replaced by one instead.

    Try figuring out what the result of stripslashes(mysql_real_escape_string($data)); will be…

    When using strip_tags, it’s important to note that the allowable tags will keep their attributes, which may contain slashes, colons, semicolons, dashes, quotes and various other chars you wouldn’t want to see messing up your query…
    For more possible issues with strip_tags, have a look at this post

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

Sidebar

Related Questions

Possible Duplicate: Does SQL Server 2005 have an equivalent to MySql’s ENUM data type?
Possible Duplicate: Does an abstact classes have a VTABLE? Does a vtable gets created
Possible Duplicate: What does “String[] args” contain in java? I want to know the
Possible Duplicate: Simulating group_concat MySQL function in MS SQL Server 2005? Does T-SQL have
Possible Duplicate: insert contacts into database but does not want to duplicate already existing
Possible Duplicate: What does mysql_real_escape_string() do that addslashes() doesn't? I have been reviewing articles
Possible Duplicate: insert contacts into database but does not want to duplicate already existing
Possible Duplicate: Best way to prevent SQL Injection in PHP What is the best
Possible Duplicate: Why does Mercurial think my SQL files are binary? I generated a
Possible Duplicate: PHP’s mysql_real_escape_string and MySQL Injection This is the character in question: \x1A

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.