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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:50:37+00:00 2026-05-27T01:50:37+00:00

I have a problem in retrieving the $_POST data from jquery serializeArray(); . I

  • 0

I have a problem in retrieving the $_POST data from jquery serializeArray();. I tried to for loop the $_POST to get the data but failed.

This is my JavaScript code:

    function update_cart(){
    var fields = $(':input').serializeArray();
    console.log(fields);
    var url = "update_cart.php";
    $.post(url, {fields:fields}, function(data) {
         alert(data);
    }, "html");
        return false;
}

In my PHP code :

var_dump($_POST);

The result is this:

array(1) {["fields"]=> string(15) "[object Object]"}

So, can anyone please teach me how to access the $_POST data?

  • 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-27T01:50:38+00:00Added an answer on May 27, 2026 at 1:50 am

    You don’t need to nest your serialized object; that seems to be what’s causing the error. Just set your post call to:

    $.post(url, fields, function(data) {
         alert(data);
         }, "html");
    

    That should work; you might also want to change from using serializeArray to using serialize.

    Once this is properly configured, if you have:

    <input name="foo" value="bar" />

    It can be accessed as:

     $_POST["foo"]; //bar
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a problem when it comes to retrieving value from jQuery to php.i
I have problem today about retrieving data from SQLite. Here is my coding public
I have a problem with retrieving data from a database using PHP statements. At
I'm have little problem in retrieving the data from a table here's the code:
We have a problem with the Euro character when saving and retrieving it from
I have a problem retrieving all the data inside the rows added by the
I have an application that is retrieving data from Facebook. Users authorize the application
I have a problem retrieving default values from the settings bundle when first launching
I have a problem retrieving items from a fairly large list. I can quickly
i am having a problem while retrieving the data coming from Json... i am

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.