in one of my front end PHP files im doing this in my Jquery :
var name = $('#core_name').val();
var param = {};
param['name'] = name;
$.ajax({
url:'../back_end/user.php/verify_name',
data:param,
type:'POST',
success:function(result){
alert(result);
}
});
In my back_end/user.php im doing this :
<?php
class User{
function index(){
//for now do nothing
}
function verify_name(){
echo "here";
}
}
?>
Why cant i alert "here", what is it that iam doing wrong ? Firebug detects no error , so the file user.php has correct path (no 404 error) why cant i reach the function verify_name ?
You need to instantiate the User
class and call verify_name()
on back_end/user.php
.
You can do this adding the following to back_end/user.php
:
$user = new User;
$user->verify_name();