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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:19:43+00:00 2026-05-17T16:19:43+00:00

I try to explain my problem with a non-perfect english :) When i try

  • 0

I try to explain my problem with a non-perfect english 🙂

When i try to send some string (client side) to the server, i see that the HTML Form add the “\” char as escape before some chars (for example with “, ‘ and \ itself).

But this is a problem : if save it on mysql, before i filter the string using mysql_real_escape_string(), and it considers the escape char added by html as a “char added by the user”. But that’s not true.

The same when, after I checked the value on server-side and ignore it for some reason, i place them on the fields. I need to escape the chars again (i do it with addslashes() php function), because if i have $var equal to hello “world” how are you, on the input field (as i wrote above) it fails.

So, how can I fix this problem? I think there’s a solution 🙂

Part 2

Now, with magic_quotes i’ve resolved this problem. Now, if the parameter fails when i check it, i’ll save it on a var and put it into the right field. The problem is that.

<script type="text/javascript">
    $(document).ready(function() {
        $("#input1").val("<?= addslashes($name) ?>");
    });
</script>       

<input class="inputReg" maxlength="20" name="name" id="input1" />

this code work!!! I put the value (trought JQuery). If i write this :

<input class="inputReg" maxlength="20" name="name" value="<?=addslashes($name)?>" id="input1" />

it doesnt work. In fact, if i write (for example) the string “hello ‘my’ name is marco” it add each time 1-2-4-8 the char \ before. Why this? It doesnt works. Any idea? Cheers

  • 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-17T16:19:43+00:00Added an answer on May 17, 2026 at 4:19 pm

    Sounds like magic quotes. Make sure this is disabled in your php.ini file:

    magic_quotes_gpc = Off
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm going to try to explain the problem. I am getting a string containing
I will try to explain my problem. I have 4 files index.html, event.js, start.js
I will try to explain the problem that I have with this code. This
I try to explain the whole problem with my poor english: I use to
I'll try to explain my problem as clear as I can: Imagine that we
I try to explain my problem. I have a first view in which I
I'll try to explain my problem as clear as possible :). I am using
All right, I'll try to explain my problem as clearly as I can. I
I have a problem and I will try to explain the issue: I have
I am not entirely sure how to explain my problem but I will try.

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.