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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:01:03+00:00 2026-05-17T19:01:03+00:00

I am building a web application that is supposed to make it easier for

  • 0

I am building a web application that is supposed to make it easier for users to generate correct XML for a given utility.

As a simple test, I created a textarea that contains the generated XML. I then created a button (<input type="button">) with a jQuery handler that will send the contents of the text area to my PHP application, which will massage the data and place the various items into a . The code I am using the send the data to PHP is as follows (assume ‘this’ is a complex object, and doImport() is a function within that object… this is working properly):

doImport :  function () {
  var $ = this.jQuery,
   js = this,
   xml = $('textarea#xmlInput').val();

  $.post(this.selfRef, {
   import : xml
  }, function (json) {
   if (json.status) {
    $('table#tableArea tbody').html(json.tableInfo);
   } else {
    alert("Error occurred:\n" + json.message);
   }
  }, 'json');
 },

I can examine the data using Firebug, and I’m correctly getting the XML data from the text area. I expect my PHP application to generate a JSON result.

Next, on the PHP side, when I retrieve the POST information using $_REQUEST['import'], I’m getting the following:

<?xml version=\"1.0\"?> [...]

In other words, the double quotes are being escaped by backslashes.

I’ve tried examining the string character by character, and I’m indeed seeing the backslashes in the string returned by $_REQUEST['import'].

I know I am probably overlooking something extremely simple, but for the life of me, I cannot figure out what I’m doing wrong.

Regards,

lar3ry

  • 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-17T19:01:03+00:00Added an answer on May 17, 2026 at 7:01 pm

    Your PHP installation has “magic_quotes” turned on. It’s a “security” feature introduced long ago. (Really it just causes problems like this IMHO).

    I believe you have to turn it off in the php.ini (usually found in /etc if you’re using linux). Change

    magic_quotes_gpc = On 
    

    to

    magic_quotes_gpc = Off
    

    If that doesn’t work you can use the stripslashes() function on your input.

    $_POST['import'] = stripslashes($_POST['import']);
    

    Hope that helps!

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

Sidebar

Related Questions

I am building a web application that will need to allow users to save
I'm building a web application that shows users interesting visualizations of their Gmail activity
I'm building a web application that requires users to provide their location (similar to
I am building a web application that will essentially allow authenticated users access to
I am building a web application that will let users follow discussion threads, in
I'm currently building a web application that has multiple user types, where users engage
I'm building a web application that guides my users through the configuration and installation
I am building a web application that uses the database for Users, Security/roles, and
We're building a web application that is available to both authenticated and anonymous users.
I'm building an web application that I want users to have specific permissions to

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.