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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:57:50+00:00 2026-05-31T06:57:50+00:00

im trying to pass an array of data to a PHP script using Jquery’s

  • 0

im trying to pass an array of data to a PHP script using Jquery’s AJAX; this is my JS:

var dataObject = {
    shippingDataRow: [{
        name: $('#shippingData_name').val(),
        street: $('#shippingData_street').val(),
        number: $('#shippingData_number').val(), 
    }]

};

$.ajax({
    type: "post",
    data: { action: 'test', data: dataObject },
    cache: false,
    url: "php/post_test.php",  
});

And this is the PHP (just doing some tests, before I can write all procedures),

<?php
    function test(){
        $dataObject = $_POST['dataObject'];
        print_r( $dataObject );
    }
?>

In Chrome’s Developer Tools, I can see the Status Code:200 OK; even all the array with the correct values, but when I open the php it doesn’t work.

Any ideas?

  • 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-31T06:57:52+00:00Added an answer on May 31, 2026 at 6:57 am

    try: $dataObject = $_POST['data'];

    You need to refer to the key of the posted data, not the value in javascript.

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

Sidebar

Related Questions

I'm trying to pass an array to jquery's .ajax() function's data parameter. The first
Possible Duplicate: Passing JavaScript Array To PHP Through JQuery $.ajax I'm trying to pass
i'm trying to pass a javascript array to a php controller ( i'm using
I'm trying to understand how my PHP script can pass an array to my
I am trying to pass dynamically created form fields to a php script, and
I have a login form using jquery ajax and a php code. The issue
I am trying to upload a file using php,and i need to pass a
I'm trying to send an array to a PHP script via POST method. First
In order to pass array variables via my curl script, I am using serialize
I'm trying to pass multiple checkboxes with different values to a PHP script that

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.