php - Is there an ajax library for CodeIgniter that can invoke private controller methods and that currently works? -
The last time I did PHP I worked with CodeIgniter I used the XAxx Library to implement AJAX, which is extremely Was simple and was able to run private controlling methods. Unfortunately, XAJAX does not seem compatible with the latest version of CodeIgniter, or it may be that it is not compatible with php5.2 / 5.3.
I was thinking of using jQuery, but since jQuery sends requests for an accessible URL it is not able to apply personal methods for some reasons I have private controller methods for AJAX functionality Because I do not want to get this work done directly through a URL.
So, there is an AJAX library for codeigner, can you implement private controller methods?
Edit: The answer to the triff has been telling me that one of the jQuery Post () is the method. However, I'm still looking for a library for codeigner which plugs AJAX functionality into the framework. Instead of typing jQuery into my templates, I prefer to work with AJAX via PHP and CodeIgniter. Is there a library still? HM is a strange question in this approach: If you want to call some javascript on your server, You can do it in two ways (ignoring the web sockets for this time):
- A GET request where only one URL string and header is sent to the server. Along with, you enter your request information in the URL.
- A post request where the message of arbitrary length is sent along with your URL and header, in this method you can keep variables in your URL, but it would be wise to place your message in the body. It is important to note that jQuery has a GET method and a post method, so your comment about jQuery "sends a request for an accessible URL" is true, but incomplete This also.
With any method, it is impossible to hide something from a dedicated brain, about which governing methods you are applying or how you invite them. If you send your information through GET or Post, they can easily simulate that function in your browser and send a request to your controller which is in your code that replicates completely. For anything public-facing, you want more comprehensive protection measures (where needed) rather than limiting URL access directly into controlling tasks.
So back to your question ... "It is not accessible through this URL" ... it seems to solve a strange problem because if you access it via URL If you can not, you can easily access it through a POST request. But ignoring this for a moment, the way I will do it is ...
-
Create a public governing system that will come to the next post request (or post requests Of the group). In search of this method for specific method, which will tell your controller what personal methods are called.
-
In JavaScript, include a variable in your POST message which is whatever you like. You can think of this as your method triggering which will be read to decide how a personal method is described by your controller as described above.
A CI AJAX library that you can find that "reaches private ways" is definitely some derivation of this Remember : Whatever you do in your JavaScript can be viewed by others, and therefore can be repeated.
-
Comments
Post a Comment