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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T03:40:01+00:00 2026-05-21T03:40:01+00:00

I have a contact edit form. The entire form is requested through ajax (loaded

  • 0

I have a contact edit form.

The entire form is requested through ajax (loaded into a lightbox).

The form is preloaded with the contacts data.

When you click edit jQuery checks for the differences in the form and sends only the changed inputs back.

This works fine except.

on localhost doing echo $_POST['data'] gives [{"name":"firstName","value":"James"}]

doing it on production gives [{\"name\":\"firstName\",\"value\":\"James\"}]

Where are the extra \ coming from.

If it helps

localhost = windows, php 5.3
production = linux php 5.2

let me know if you need any more code

var contact = $(this).attr('rel');
$.facebox(function() {
  $.ajax({
    url: site_url + 'ajax/contact',
    type: 'POST',
    data: {
      id: contact,
      method: 'editForm'
    },
    success: function(data) {
      $.facebox(data);
      $('#editForm').submit(function() {
        var data = [];
        var finalForm = $(this).serializeArray();
        var differences = 0;
        for (var i in initialForm) {
          if (!objectsAreSame(initialForm[i], finalForm[i])) {
            data[differences] = finalForm[i];
            differences++;
          }
        }
        if (differences > 0) {
          $.ajax({
            url: site_url + 'ajax/contact',
            type: 'POST',
            data: {
              id: finalForm[0].value,
              method: 'editContact',
              data: JSON.stringify(data)
            },
            success: function(data) {
              $('#contact' + finalForm[0].value).hide("drop", {direction: 'up'}, 500, 
              function() {
                $('#contact' + finalForm[0].value).replaceWith(data);
                $('#contact' + finalForm[0].value).show("drop", {direction: 'up'}, 500, function() {
                  $(document).trigger('close.facebox');
                });
              });
              return false;
            }
          });
        }
        $(document).trigger('close.facebox');
        return false;
      });
      $('#accordion').accordion();
      initialForm = $('#editForm').serializeArray();
    }
  });
});
  • 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-21T03:40:02+00:00Added an answer on May 21, 2026 at 3:40 am

    Have a look at http://php.net/manual/en/security.magicquotes.php . On you development machine, since you are running 5.3.0 they are deprecated. On your production machine they are enabled. Check on how to disable them but be sure to double-check your code.

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

Sidebar

Related Questions

I have a contact us form that uses Ajax (i.e. relies on asynchronous requests).
EDIT: my revised Entity relationship diagram A Student can have many contact times but
i have a contact form sending itself to me by email using ASP classic,
I have a contact form where the email is actually accessible in the source,
I have a contact form that can be hidden using .slideToggle() but I want
The basics: I have a contact form that uses php to validate the forms.
I have a browser interface with a ul#contacts list on the left and div#contact
I have a form where I'm collecting contact information (name, address, etc) for an
I have an HTML5 form set up like so: <form id=contact-form action=php/email.php> <fieldset> <ul
another django question. I have a edit form like this. Look at current_status in

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.