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

  • Home
  • SEARCH
  • 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 6193463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:07:31+00:00 2026-05-24T03:07:31+00:00

I try searching about this but I just can’t find any that can solve

  • 0

I try searching about this but I just can’t find any that can solve my problem. I want to produce a url like to this to send request to my webservice:

http://localhost/jQueryStudy/RamagalHTML/processjson3.php?
path=update%2FtallyHdr&json=
{"SessionID":"hHuCG3Jt1um5gV7kE320Bw7EjG97I4qZ","operation":"add",
"transaction_date":"2011-7-29","supplier_id":"10000000108","wood_specie_id":"1",
"lines":[{"plank_number":"7","thickness":"5","width":"8","length_t":"8","quantity":"1","board_foot":"26.67","wood_classification_id":"1","price":"15"}],"scaled_by":"WER","tallied_by":"WE","checked_by":"WE","total_bdft":"580.00","final":"N"}

Here’s my current javascript code i have right now:

var dataJSON = {
    "SessionID": $.cookie("SessionID"),
    "operation": "add",       
    "transaction_date":$('#tallyDate').val(),
    "supplier_id":$('#supplierInput').attr("name"),
    "wood_specie_id":$('#woodSpecie').attr("name"),   
    "lines":plank_data,
    "scaled_by":$('#tallyScaled').val().toUpperCase(),
    "tallied_by":$('#tallyTallied').val().toUpperCase(),
    "checked_by":$('#tallyChecked').val().toUpperCase(),
    "total_bdft":$('#tallyTotal').val(),
    "final":"N"
  }; 
  alert('this is the datajson from add :   '  + JSON.stringify(dataJSON));

  $.ajax({
    type: 'POST',
    data: dataJSON,
    url: 'processjson2.php?path=update/tallyHdr',
    dataType: primeSettings.ajaxDataType,
    success: function(data) {
      if ('error' in data)
      {
        showMessage('ERROR: ' + data["error"]["msg"]);
      }
      else{
        $('#tblTallyHdr').trigger('reloadGrid'); 
      }
    }
  });

My .php code is this:

<?php
   $data_url = http_build_query (array('json' => $_REQUEST["json"]));
   $data_len = strlen ($data_url); 

echo file_get_contents("http://localhost:8001/" . $_REQUEST["path"], false, stream_context_create(
    array (
        'http' => array(
            'method'=>'POST',
            'header' => "Connection: close\r\nContent-Length: $data_len\r\n",
            'content'=>$data_url
        )
    )
));

Evrytime I run my program, the url is only this http://localhost/jQueryStudy/RamagalHTML/processjson2.php?path=update/tallyHdr, the data was not posted which makes my request not executed. Please help me on this. I don’t know how to fix my php.

  • 1 1 Answer
  • 3 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-24T03:07:32+00:00Added an answer on May 24, 2026 at 3:07 am

    If you’re wanting all your data to be sent as part of the URL then you should use GET, not POST.

    It’s therefore possible to do away with the data property and append everything to the request URL:

    $.ajax({
        type: 'GET',
        url: 'processjson2.php?path=update/tallyHdr&json='+dataJSON,
        dataType: primeSettings.ajaxDataType,
        success: function(data) {
          if ('error' in data)
          {
            showMessage('ERROR: ' + data["error"]["msg"]);
          }
          else{
            $('#tblTallyHdr').trigger('reloadGrid'); 
          }
        }
      });
    

    If you must use POST, then you just need to provide a variable name to go with your json:

    $.ajax({
        type: 'POST',
        data: "json="+dataJSON,
        url: 'processjson2.php?path=update/tallyHdr',
        dataType: primeSettings.ajaxDataType,
        success: function(data) {
          if ('error' in data)
          {
            showMessage('ERROR: ' + data["error"]["msg"]);
          }
          else{
            $('#tblTallyHdr').trigger('reloadGrid'); 
          }
        }
      });
    

    For more info, see the examples towards the end of the page: http://api.jquery.com/jQuery.ajax/

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

Sidebar

Related Questions

Having an annoying small problem. Cannot find the solution that works tried just about
I've been searching a lot but I haven't found anything about this question. I'm
I can't seem to find this on msdn been searching for a bit (described
Disclaimer: I did try searching first, and even found this comment , but it
This seems so basic that people would be screaming about it, searching the web
There are a lot of websites that look professional in Google results. Try searching
I've been searching the web for a way to do this for about a
I tried googling and searching on stack but I didn't find anything :-( (
OK, I've spent a bunch of time searching and reading, and not just this
I've found so many existing questions asking about this error but none of them

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.