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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:08:52+00:00 2026-05-20T10:08:52+00:00

I am using jQuery and PHP to write JSON data to my server. I’m

  • 0

I am using jQuery and PHP to write JSON data to my server. I’m processing a decent amount of repeating numeric data (~.75kb), so I want to pass the data to PHP in the form of a multidimensional array.

At the moment I cannot manage to get the data to PHP in a form that it can recognize. I’ve tried various combinations of sending/receiving as arrays and objects with no success.

The best case scenario would be one in which I pass a the array to the PHP and the PHP converts it to a readable form. I’d rather not use associative arrays or any serializing on the part of the Javascript.

Code… This is giving me a 500 internal server error, which no longer occurs if I omit the passed data variable. (I’m not yet using $data in the php file yet because I know it’s not working.)

function generateData() {
  // code here
  return [ one[ sub_one[], sub_two[] ], two[], three[], four[] /* Etc... */ ]
}
function saveData() {
    $.ajax({
        url: "scripts/save.php",
        data: {
            "area":"testing",
            "location":"testing",
            "name":"testing",
            "data":generateData()
        }
    });
}
<?php
    $area = $_GET['area'];
    $location = $_GET['location'];
    $name = $_GET['name'];
    $data = $_GET['data']);

    # Performing operations with variables...

    echo 1;
?>

Thanks for any help you can offer.

  • 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-20T10:08:52+00:00Added an answer on May 20, 2026 at 10:08 am

    Found a solution:

    "data": {
        data: generateCellData()
    }
    

    The above code passes data as an object to PHP, whereby I can access the original array as $data(“data”). I’m still somewhat baffled by why this works when I’m already passing the data and other parameters as an object.

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

Sidebar

Related Questions

I am using jQuery, JavaScript and PHP. My Ajax.php file just displays the data.
I am using PHP, jQuery, and JSON. Now I need to know how to
I'm using jQuery to post a form to a php file, simple script to
I am using jQuery and Ajax, and my Ajax.php file returns the following field
I make an AJAX request like so using JQuery: $.ajax({ type: GET, url: getvideo.php,
I am using JavaScript, jQuery and PHP. How do I limit the JavaScript function
I've rewritten my family web site using JavaScript (JQuery) making Ajax calls to PHP
I don't understand one thing. If I want to get JSON data (key-value-pairs) from
Using jQuery , how can I dynamically set the size attribute of a select
Using jQuery, how do you bind a click event to a table cell (below,

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.