Tanja Posted July 13, 2022 Share Posted July 13, 2022 I am using this login-script, but i am not able to translate the errormessages. f.e. function register($subuser, $subpass, $subconf_pass, $subemail, $subconf_email, $subfirstname, $sublastname, $subkennel, $subdog, $subidentify){ global $database, $form, $mailer; //The database, form and mailer object $token = $this->generateRandStr(16); $config = $database->getConfigs(); /* Username error checking */ $field = "user"; //Use field name for username if(!$subuser || strlen($subuser = trim($subuser)) == 0){ $form->setError($field, "*Username not entered"); } i have languages files, fetched via url. In this file there are the translations. I tried $form->setError($field, $username_already_used); //nothing is shown $form->setError($field, "."$username_already_used"."); //Parse error: syntax error, unexpected '$username_already_used' (T_VARIABLE) in /www/htdocs/w00fa8ed/include/session.php on line 299 $form->setError($field, "*".$username_already_used."*");//only shown ** $form->setError($field, $$username_already_used);//nothing is shown $form->setError($field, "* Username not entered x {$username_already_used} xx");//* Username not entered x xx any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/315037-xavier-php-login-script-user-management-admin-panel-translation/ Share on other sites More sharing options...
Barand Posted July 13, 2022 Share Posted July 13, 2022 It would appear that the variable $username_already_used is empty. Quote Link to comment https://forums.phpfreaks.com/topic/315037-xavier-php-login-script-user-management-admin-panel-translation/#findComment-1598182 Share on other sites More sharing options...
mac_gyver Posted July 13, 2022 Share Posted July 13, 2022 19 minutes ago, Tanja said: i have languages files, fetched via url. if by that you mean you are requiring a .php language definition file using a URL, that won't work, since only the output (echo/print) from that file will be required. you must use a disk filesystem path/filename to require the file. Quote Link to comment https://forums.phpfreaks.com/topic/315037-xavier-php-login-script-user-management-admin-panel-translation/#findComment-1598183 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.