Hello everyone!

I have a question .. i have a js file (script.js) and a php file (script.php) , in the php file i have a code that verify a user and in the script js i have this:

var uname = name.val();
        $.post('HERE IS THE QUESTION' , {names:uname} , function(data){
            if (data != 1){
                nameInfo.text("This name is already registered!");
                state = false;

My question is : How can i call the object that verify the username from scrip php ( This is made like the code below ) in the script.js .. the folder is core / script.php & core/script.js

class VerifyScript{

    function verify(){


Thank you in advance !

POST to the URL of the php script.

Ok , actually , you didn't understand or I didn't understand the answer ..is not a php script , is a function , how can i call the FUNCTION from the CLASS from the php script?

The php look like this :


class 1{



class 2{

    function ANOTHER_FUNCTION{
    #code of another function


And I need to call the function "I_NEED_TO_CALL_THIS_FUNCTION" from the Class "1"


in script.php
if(isset($_POST['names'])) print_r($_POST['names']);