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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:57:28+00:00 2026-06-10T08:57:28+00:00

i want to send a jquery object to a php function using post my

  • 0

i want to send a jquery object to a php function using post my object comes in then i stringify it and get the following output

[
  {
    "id": "701",
    "user_id": "2",
    "playlist": "ukg%20garage",
    "tracks": "5",
    "thumbnail": "Coldplay.jpeg",
    "createdon": "2012-08-23 16:06:46"
  }
] 

so i then pass this thru with post as below

var sendData = JSON.stringify(data, null, 2);
console.log(sendData);
$.post('<?php echo base_url(); ?>account_media/updateplaylistpicture', sendData, function(response) {

            console.log(response);

          });

and with my php i am doing a print_r($_POST) but its returning nothing

Array
(
)

Where am i going wrong thanks

UPDATE I MANAGED TO SUSS IT WITH THE BELOW

var sendData = JSON.stringify(data, null, 2);
var sendData = sendData.replace(/[\[\]']+/g,'');
$.post('<?php echo base_url(); ?>account_media/updateplaylistpicture', jQuery.parseJSON(sendData), function(response) {
    console.log(response);
});
  • 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-06-10T08:57:29+00:00Added an answer on June 10, 2026 at 8:57 am

    That is very likely because the POST does not contain any “key”.
    Try this:

    print_r(file_get_contents('php://input'));
    

    Another way would be to:

    $.post('<?php echo base_url(); ?>account_media/updateplaylistpicture', 'my_stuff=' + sendData, function(response) {
    
                console.log(response);
    
              });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object that I want to send with my jquery.ajax function but
Hello Sir i want send list of data to php server i use following
edited: This is what i need: sendpost = function(a,b,c){ return jQuery.post('inc/operations.php', {a:b}, c, json);
I want to send a JSON object to facebook, but only using javascript/ajax i.e
I want to send a JSON object to a PHP file while my script
I want to send a few variables and a string with the POST method
I want to send SMS using LWUIT. what class should i be looking at?
I have a few arrays that I want to send to process with PHP.
I want to create a dictionary containing array and send it to GAE using
I am using $.ajax function to send json data to serverside function. var jsonObjects

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.