Form available in two languages

I’m using php. I have a form which fields are in french. I’d like to know how can I make the form avalaible also in english and let the user choose the language. Is there a simple way to do this?Thanks……………………………………… If your …

via PHP Website Development » Search Results » ajax:

Form available in two languages

I’m using php. I have a form which fields are in french. I’d like to know how can I make the form avalaible also in english and let the user choose the language. Is there a simple way to do this?
Thanks
………………………………………

If your form is not too large use javascript to toggle visibility of labels and messages. If you still want PHP use arrays
// Here you asign a default language
if (! isset($_GET[‘lang’]) $_GET[‘lang’]=”en”;
// Here is your bilingual vocabulary
$arr = array(
“fr” => array(“setName”=>”Saisissez votre nom: “)
,
“en” => array(“setName”=>”Input your name: “)
);
?>And your form:

Francais |
EnglishYou can use also AJAX to switch language but we are going too far :)

For more info: Form available in two languages

PHP Website Development » Search Results » ajax

Form available in two languages

Share this post:

Related Posts

Leave a Comment