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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:55:02+00:00 2026-06-17T23:55:02+00:00

My web application does Ajax request to a Codeigniter-php code in a remote server.

  • 0

My web application does Ajax request to a Codeigniter-php code in a remote server. It works in localhost but not with a specific controller in remote host. It is strange because works in localhost for both controllers.
The request:

$.ajax({
    async:true,
    type: "POST",
    dataType: "json",  
    url:"/CI/site/index.php/contact/submitContact",
    data: "", //data example 
    success:arrived,
    error:problems }); 

function arrived(data){
    var dataJson = eval(data);                       
}
function problems(){            
    $("#result").text('Problems.');     
}

I check the arrived with log_message. With the next function works fine:

  function submitContact(){
     log_message('error', 'submitContact. ');
    //If data are received
    if($_POST){
            log_message('error', 'data. [application/controllers/contact.php]');
        }   
    }

However, If I change the request to url:"/CI/site/index.php/control/controlHome", there isn’t any log message and the output is the next:
POST http://www.page.com/CI/site/index.php/control/controlHome 500 (Internal Server Error)

The function /application/controllers/control.php is the next:

 function controlHome(){
    log_message('error', 'controlHome. [application/controllers/control.php]');
    //If data are received
    if($_POST){
         log_message('error', 'data. [application/controllers/control.php]');
    }   
 }

Also I’ve tried with complete url in the ajax code but the result is the same. Any setting is required?

  • 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-17T23:55:03+00:00Added an answer on June 17, 2026 at 11:55 pm

    Check this AJAX csrf protection with codeigniter 2. This solve my same problem

    http://aymsystems.com/ajax-csrf-protection-codeigniter-20

    UPDATE:
    I checked your control.php file on my test server.

    if($_POST) { /* i only commented gangway library functions  */
    } else { /* only replace the load->view with an print_r $data; and its work */ }
    

    And put to comment the gangway library on construct. And control/controlHome works normaly without any error. Check your gangway library THAT’s cause error 500.

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

Sidebar

Related Questions

Why does the code below work fine when I run my web application localhost
I am designing a web application that does server side image processing in real
I have a web application build on PHP that (does some processing and) displays
I added Comet servlet into Spring web application. This servlet does not differ from
I want to write an Ajax web application, a game to be specific. Two
I'm having trouble with a synchronous AJAX request. I am creating a web application
I have an ajax heavy web-application built using PHP, jQuery. I am looking for
I'm creating the server side implementation of an AJAX based web application, where the
Currently I am working on a ajax-based web application that does some XHR. I
Does anyone knows a web application security scanner for mac and easy to install?

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.