This one is very simple. In codeigniter
I can have an ajax call like:
$.ajax({
type: "POST",
url: base_url + "index.php/mycontroller/myfunction"
//so in mycontroller.php ^ there is function myfunction ()
data:{id : id},
success:function(data){
};
})
Since class Mycontroller extends CI_Controller
.
So how can I do that in raw PHP
if I have posted.php
, how can I extend this file in order for me to call a function like this:
<?php
function test(){
echo 'Hello World!';
}
What i'm thinking is like:
$.ajax({
type: "POST",
url: "posted.php/test", //go to posted.php and call test function if possible
data:{id : id},
success:function(data){
};
})
But this one is not working. So any help?