Possibly Multi Language User Error Notification

48 views Asked by At

I am trying to set up error notification system for the form I created. So lets say one field is not filled, the form needs to give it a warning. I am sending and receiving the form on the same page so users don't feel like they are going around multiple pages when submitting. How can I make it so I can record all errors in one page and make it multilanguage so I can add other language warnings if used selected to use some other language.

I think what I planned is not very useful since in either if scenarios I am including a whole php file and not even multi language. I am totally lost on making this multilanguage warning.

Here is the php code for the form checker and error reporting

if ((isset($_POST['dSubject']))
                 && 
        (isset($_POST['dStory']))) 
    {
        require_once('/action/submit.php'); 
    } elseif(!isset($_POST['dSubject'])) {
        require_once('inc/errors.php');
        $err = $dERR7538;
    } elseif(!isset($_POST['dSubject'])) {
        require_once('inc/errors.php');
        $err = $dERR6483;
    } else {

    }
1

There are 1 answers

0
Qaisar Satti On

follow this link how the multi-language works. This will help you how multi-language will work.define error array like this.

$curr='lang'; //this will be your current language

$error= array();

$error['lang'] = 'first language error';
$error['lang1'] = 'second language error';
$error['lang2'] = 'third language error';

echo $error[$curr];