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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:38:34+00:00 2026-05-23T13:38:34+00:00

If I have, in javascript, something like: entriesObj1 = new Object(); entriesObj1.entryId = abc;

  • 0

If I have, in javascript, something like:

entriesObj1 = new Object();
entriesObj1.entryId = "abc";
entriesObj1.mediaType = 2;
entriesObj2 = new Object();
entriesObj2.entryId = "def";
entriesObj2.mediaType = 1;

var entries = new Array();

entries[0] = entriesObj1;
entries[1] = entriesObj2;

What is the best method to pass it to php through an HTTP POST?

I’ve tried a jQuery plugin to convert the array to JSON. I’ve tried to create multiple hidden fields named “entries[]”, each one with the JSON string. Somehow, I can’t seem to decode my data with PHP’s json_decode.

EDIT:
I tried changing the JSON plugin used to the one @Michal indicated and the results I get are the same:

Javascript

[
    {"disciplina":"sdfsdfsdfsd","titulo":"sdfsdfsdf","componentes":"Bloco Completo"},
    {"disciplina":"sdfsdfsdfsd","titulo":"sdfsdfsdf","componentes":"Bloco Completo"}    
]

PHP Vardump:

string(756) "
[
    {\"disciplina\":\"sdfsdfsdfsd\",\"titulo\":\"sdfsdfsdf\",\"componentes\":\"Bloco Completo\"},
    {\"disciplina\":\"sdfsdfsdfsd\",\"titulo\":\"sdfsdfsdf\",\"componentes\":\"Bloco Completo\"}
]
"

When I use PHP’s json_decode, I get NULL.

var_dump(json_decode($_REQUEST['entries']));

Output:

NULL
  • 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-23T13:38:35+00:00Added an answer on May 23, 2026 at 1:38 pm

    well, the trouble seemed to be with the quotes that were being passed in the post, so i just replaced the quotes with open strings to my $_REQUEST.

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

Sidebar

Related Questions

I have a Javascript object like this: var count = { table:19, people:39, places_details:84,
I have a JavaScript array of objects with the same properties each, something like
I have a javascript function that goes something like this: function doSomething(me) { var
I have a rails template (.rhtml file) generating a Javascript object. It looks something
I have a JavaScript object like: appointerment= {ids: '15,16,17', appointments: {'15': '12.05.2010,14,05,2010'} } now
I have many JavaScript objects in my application, something like: function Person(age) { this.age
I have a Javascript form validator function something like switch (element.getAttribute('validationtype')) { case 'text':
I have a JavaScript array of objects like this: box[0] = {...} box[1] =
Is there a way in JavaScript to have something like an event that listens
i have javascript jquery that looks like this: var userInput = prompt(Liquid Handler #:,

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.