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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:56:32+00:00 2026-06-06T22:56:32+00:00

I have to escape some inputs on a form. I used mysql_real_escape_string to escape

  • 0

I have to escape some inputs on a form. I used mysql_real_escape_string to escape the value but it adds a lot slashes with value inside database, the reason is i have an apostrophe in my input let us say exp’s.

Now to get rid of slashes, I use stripslashes after mysql_real_escape_string and then data goes to database successfully and don’t see any apostrophe with value in database.

$name = mysql_real_escape_string(trim($_POST['userame']));
$name = stripslashes(stripslashes($userame));

// then data goes to db successfully without apostrophe

I just wanted to confirm, is this correct way of escaping the input value? Thanks

Dayan

  • 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-06T22:56:33+00:00Added an answer on June 6, 2026 at 10:56 pm
    1. Disabling Magic Quotes
    2. mysql_real_escape_string(stripslashes($_POST['username']));
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i've a particular js function that encrypts some form inputs into base64, but I
I have some grid which use form edit. But after edit success then page
I have this login script, but for some reason its not working. I checked
I have a simple form with some PHP code to post to a database
I have a function that saves cookies cookievalue= escape(document.passwordCheck.oldPassword.value) + ;; document.cookie=oldCookie= + cookievalue
I have successfully used ajax to refresh in-line, via ajax, a contact form. I'm
Ok I have a user form that has values submitted to the database. My
I have made some statistics which I want to insert into database to see
My form saves user inputs (inputs+textarea) into a flat file database. I found lots
I have some Perl code that translates new-lines and line-feeds to a normalized form.

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.