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

The Archive Base Latest Questions

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

This only happens in lighthttpd not apache or anything else. The code actually runs,

  • 0

This only happens in lighthttpd not apache or anything else. The code actually runs, but I don’t get the response back in ajax or via a regular post.

Request/Response

Request URL:http://awcpos.no-ip.org/index.php/items/save/529
Request Method:POST
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
Content-Length:250
Content-Type:application/x-www-form-urlencoded
Cookie:phppos=a%3A4%3A%7Bs%3A10%3A%22session_id%22%3Bs%3A32%3A%2269a65a5b0f1df2f41289c3feb63212d1%22%3Bs%3A10%3A%22ip_address%22%3Bs%3A14%3A%2272.230.180.236%22%3Bs%3A10%3A%22user_agent%22%3Bs%3A50%3A%22Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_6_8%29+App%22%3Bs%3A13%3A%22last_activity%22%3Bi%3A1312596392%3B%7D74087fe11a84808da34458abdb0b7f0d
Host:awcpos.no-ip.org
Origin:http://awcpos.no-ip.org
Referer:http://awcpos.no-ip.org/index.php/items
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1
X-Requested-With:XMLHttpRequest
Form Dataview URL encoded
item_number:
name:Test
category:Test
supplier_id:
cost_price:1.00
unit_price:2.00
tax_names%5B%5D:GST
tax_percents%5B%5D:
tax_cumulatives%5B%5D:0
tax_names%5B%5D:
tax_percents%5B%5D:
quantity:10
reorder_level:1.00
location:
description:
submit:Submit
Response Headersview source
Content-Length:0
Content-type:text/html
Date:Sat, 06 Aug 2011 02:13:25 GMT
Server:lighttpd/1.4.29
X-Powered-By:PHP/5.3.6

Code: (It is json coming back)

   function save($item_id=-1)
    {
        $item_data = array(
        'name'=>$this->input->post('name'),
        'description'=>$this->input->post('description'),
        'category'=>$this->input->post('category'),
        'supplier_id'=>$this->input->post('supplier_id')=='' ? null:$this->input->post('supplier_id'),
        'item_number'=>$this->input->post('item_number')=='' ? null:$this->input->post('item_number'),
        'cost_price'=>$this->input->post('cost_price'),
        'unit_price'=>$this->input->post('unit_price'),
        'quantity'=>$this->input->post('quantity'),
        'reorder_level'=>$this->input->post('reorder_level'),
        'location'=>$this->input->post('location'),
        'allow_alt_description'=>$this->input->post('allow_alt_description'),
        'is_serialized'=>$this->input->post('is_serialized')
        );

        $employee_id=$this->Employee->get_logged_in_employee_info()->person_id;
        $cur_item_info = $this->Item->get_info($item_id);


        if($this->Item->save($item_data,$item_id))
        {
            //New item
            if($item_id==-1)
            {
                echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_adding').' '.
                $item_data['name'],'item_id'=>$item_data['item_id']));
                $item_id = $item_data['item_id'];
            }
            else //previous item
            {
                echo json_encode(array('success'=>true,'message'=>$this->lang->line('items_successful_updating').' '.
                $item_data['name'],'item_id'=>$item_id));
            }

            $inv_data = array
            (
                'trans_date'=>date('Y-m-d H:i:s'),
                'trans_items'=>$item_id,
                'trans_user'=>$employee_id,
                'trans_comment'=>$this->lang->line('items_manually_editing_of_quantity'),
                'trans_inventory'=>$cur_item_info ? $this->input->post('quantity') - $cur_item_info->quantity : $this->input->post('quantity')
            );
            $this->Inventory->insert($inv_data);
            $items_taxes_data = array();
            $tax_names = $this->input->post('tax_names');
            $tax_percents = $this->input->post('tax_percents');
            $tax_cumulatives = $this->input->post('tax_cumulatives');
            for($k=0;$k<count($tax_percents);$k++)
            {
                if (is_numeric($tax_percents[$k]))
                {
                    $items_taxes_data[] = array('name'=>$tax_names[$k], 'percent'=>$tax_percents[$k], 'cumulative' => isset($tax_cumulatives[$k]) ? $tax_cumulatives[$k] : '0' );
                }
            }
            $this->Item_taxes->save($items_taxes_data, $item_id);
        }
        else//failure
        {
            echo json_encode(array('success'=>false,'message'=>$this->lang->line('items_error_adding_updating').' '.
            $item_data['name'],'item_id'=>-1));
        }

    }
  • 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-24T09:08:09+00:00Added an answer on May 24, 2026 at 9:08 am

    Json wasn’t enabled which caused the problem

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

Sidebar

Related Questions

This only happens in IE6. With the following code I get the error 'jQuery'
I am not sure whether this only happens to me. Basically if I have
I am authenticating users in ldap, but this happens only once, when user is
This only happens from time to time, seems random and I have not been
This code works in FF, Chrome, IE6/8 but not in Safari and Opera. Any
This only happens in some IE's. Here: http://animactions.ca/Animactions/volet_entreprise.php You may notice that when you
Im getting this linker error that won't let me compile. It only happens on
This is an odd behaviour by my D2006 as it happens sometimes only. I
I have tried : c(module_name). : but this only works from the shell, and
This only happens on my local machine (Windows 7, Ruby 1.8.7). Occasionally rails will

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.