0

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){
                name.removeClass('valid');
                nameInfo.removeClass('valid');
                name.addClass('error');
                nameInfo.addClass('error');
                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(){
    #code
    }

}

Thank you in advance !

2
Contributors
4
Replies
14
Views
4 Years
Discussion Span
Last Post by MWEB
0

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 :

<?php 

class 1{

    function I_NEED_TO_CALL_THIS_FUNCTION{
    #code
    }

}

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"

Edited by MWEB

1

$.post('script.php'

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

Edited by Unimportant

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.