Topic: Failed to locate registration method for the following

Hello !

I am French, I am verry sorry for the syntax of my sentence.
I have learned XAJAX since a few days.

I have weite this script for a chat :

        function afficher() {
            $reponse = new xajaxResponse();
            $posteur = $_SESSION['pseudo'];
            $chat = '';
            $query_reponse = "SELECT id, pseudo, messagechat, date FROM minichat WHERE
                                                        pseudo = '".$_SESSION['pseudo']."' ORDER BY ID DESC LIMIT 25";
            $req_reponse = mysql_query($query_reponse);
                while($donneeschat = mysql_fetch_array($req_reponse))
                    {$chat .= '<strong>' . html_entity_decode($donneeschat['pseudo'], ENT_QUOTES) . ' ' . ':</strong>' . ' ' .
                                          html_entity_decode($donneeschat['messagechat'], ENT_QUOTES) . '<br />';}
            $reponse->assign('block', 'innerHTML', $chat);
            return $reponse;
        }

        function envoyer($posteur, $messagechat) {
            $reponse = new xajaxResponse();
            $posteur = $_SESSION['pseudo'];
            $pseudo = $posteur;
            $date_envoi = time();
            $req_envoi = "INSERT INTO minichat VALUES('','".htmlentities($pseudo)."', '".htmlentities($messagechat)."',
                                                '".htmlentities($date_envoi)."')";
            $query = mysql_query($req_envoi);
            $reponse->clear('messagechat', 'value');
            $reponse->call('xajax_afficher');
            return $reponse;
        }

    require_once('./xajax_core/xajax.inc.php');
    $xajax = new xajax();
    $xajax->register(XAJAX_FUNCTION, 'afficher');
    $xajax->register(XAJAX_FUNCTION, 'envoyer');
    $xajax->processRequest();

On Localhost, i haven't problems, but on my website, I have this error :
Fatal error: Failed to locate registration method for the following: Array ( [0] => function [1] => afficher ) in /homez.305/sitedela/www/xajax_core/xajaxPluginManager.inc.php on line 301

I don't undestand why. Maye I have forgot something... I have search on this community and on the Internet. I have tried a few code, but i get the same error.

Could you help me please ? Thank you.

Re: Failed to locate registration method for the following

What version auf xajax and PHP are u using?

Re: Failed to locate registration method for the following

I am using xajax 0.5 standard and PHP 5.3.

Re: Failed to locate registration method for the following

I suggest you to try the latest xajax 0.6 revision on github. Xajax 0.5 wasn't made with PHP 5.3 in mind and therefore doesn't always work properly.

Re: Failed to locate registration method for the following

Thank you for your help.

I have installed the lastest xajax 0.6... But I have an other error :
Parse error: syntax error, unexpected T_IF in /homez.305/sitedela/www/xajax_core/plugin_layer/xajaxEventPlugin.inc.php on line 1

I am very sorry, but I don't understand this error...

Re: Failed to locate registration method for the following

Hello Lucaspeak,

The T_IF Statement results from an "buggy" Ftp-Upload
Try to upload the xajax scripts in Binary-Mode

http://community.xajaxproject.org/topic … ected-tif/

by the way you can use the beta 0.6
http://www.xajaxproject.org/en/download/ 

The version on github is currently under construction

Re: Failed to locate registration method for the following

Hello Romacron !

Thank you for your help ! And thank you for q_no !! I heven't error !! Muy problem is solved !!

Re: Failed to locate registration method for the following

Hello Lucaspeak,

please tell us your solution, what did you changed?
Other Users will be Happy ;.)