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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:09:24+00:00 2026-06-11T16:09:24+00:00

I spend already some hours on this problem and cannot find solution. I have

  • 0

I spend already some hours on this problem and cannot find solution.
I have the following service on the webpage (kohana 3.2):

public function action_test() {
    $data = file_get_contents('php://input');
    $json = json_decode($data);

    $t = array();
    $t[Utils::$KEY_LOGIN]       = isset($json->login) ? $json->login : arr::get($_POST, Utils::$KEY_LOGIN, null);
    $t[Utils::$KEY_PASSWORD]    = isset($json->password) ? $json->password : arr::get($_POST, Utils::$KEY_PASSWORD, null);

    $returned = array("success" => true);
    $returned = array_merge($returned, array("login" => $t[Utils::$KEY_LOGIN]));

    $this->auto_render = FALSE;
    ob_clean();
    $this->request->headers['Content-Type'] = "application/json";
    $this->response->body(json_encode($returned));
}

And the form to ask the service:

<html>
<head>
    <meta charset="utf-8" />
    <script type="text/javascript" src="//media/js/jquery-1.6.2.min.js">    </script>
    <script type="text/javascript" src="//media/js/jquery-ui.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#login_sb").click(function() {
                //var action = 'http://www.aaa.pl/clientservices/test';
                var action = "http://localhost/aaa/clientservices/test";
                $.ajax({
                    url : action,
                    type : "post",
                    dataType : "json",
                    cache : "false",
                    timeout: 8000,
                    data : {
                        'login': 'login@wp.pl'
                    },
                    success : function(data) {
                        alert(data);
                        if(data.success) {
                            alert(data.login);
                        }
                    } 
                });
// 
                return false;
            });
        });

    </script>
</head>
<body>
    <form id="login_form" method="post">
        <input type="submit" value="login" id="login_sb"/>
    </form>

</body>

When I call the local service everything works ok. But when I am trying to call it by Ajax remotely – it doesn’t work. It also works when I manually send the form. Please help, cause I don’t have any new ideas what is going wrong.

  • 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-11T16:09:25+00:00Added an answer on June 11, 2026 at 4:09 pm

    Are you possibly trying to call the AJAX request from a different domain?

    If you are trying to call the ajax request at this url: ‘http://www.aaa.pl/clientservices/test’

    from your local setup you will get errors, the ajax request must be made from the same domain.

    a file one localhost can’t make an ajax request to http://www.aaa.pl as it’s a different domain and a security issue in javascript.

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

Sidebar

Related Questions

I have a problem with php header redirect. I already spent hours trying to
I have spent 5 hours on this, and I've already been up 30 hours
I've spend days trying to find a solution the problem i'm going to try
I get this: Warning: session_start(): Cannot send session cookie - headers already sent by
I've spent a few hours already studying some CMS solutions for one of my
anybody knows efficiency in masking(anonymization) of some tables in a mysqldump? I have already
anybody knows efficiency in masking(anonymization) of some tables in a mysqldump? I have already
I have special implementation for my grid. For this I wrote some code in
First, forgive me if this has been answered already. I spent a few hours
I'm in need of some desperate help. I've been at this for 4 hours,

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.