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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:55:10+00:00 2026-05-23T12:55:10+00:00

This is my called by post to mi php in the server $.ajax({ async:

  • 0

This is my called by post to mi php in the server

    $.ajax({
            async: false,
            type: "POST",
            url: "services/ModelsService.php",
            data: "{IdModelo: "+$("#brand").val()+"}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function(values){
                //do something
            }   
    });

Now when i’m going to uses the value send from the js. always failed appears blank. But the data it’s sending good because when i debug the called with charles debugging proxy works well the request

the image

this is my php file

$json = json_decode($_POST,true);
echo $json[1]; //this bring me always blank

What i’m doing wrong in my code

  • 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-23T12:55:10+00:00Added an answer on May 23, 2026 at 12:55 pm
    echo $json['IdModelo'];
    

    This is how you get it.

    Passing the second argument true to json_decode will return an associative array so you should access array values using associative (string) index.

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

Sidebar

Related Questions

I've seen a plugin for Vim called AutoClose (discovered from this post) which automatically
I got this script called rapidshare link checker v2 php by Bigfish At the
I have the following PHP script being called by AJAX: <?php // file /ajax/loopback.php
I'm testing a jQuery ajax post method on a local Apache 2.2 server with
This issue is very likely codeigniter specific. I have a controller called redirect.php that
I want to make a http post to an outside url using php. By
This first script gets called several times for each user via an AJAX request.
Here's my PHP code called during jQuery AJAX call: <?php include '../code_files/conn.php'; $conn =
$.post('testeUpdate.php', 'autocomplete', function(dadosResposta) { $('#ns-nome').val(dadosResposta.nsName); $('#ns-endereco').val(dadosResposta.nsAddress); }, json); I'm trying to understand this. So,
I'm creating a Shell Script, and I have a file like this called expressions.txt

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.