Php button does not work for action

I started using a car dealer script. Unfortunately, this script cannot change the language of the visitor. Therefore, the first image of the drop-down menu where you can select English and German, I copy from the admin panel. When you change the language from English to German and refresh the page, I leave English again.

first shot

The second figure shows that this time I will send a copy of the refresh button from the admin panel, this time changing the language and clicking the refresh button, nothing happens, the language does not change when I refresh the page, then it remains the same English.

second image

The language can only be changed through the admin panel. What should I do for the visitor himself, can I change the language of the page?

this is the dropdown menu code that I am viewing from the admin panel in the header file

<div class="field">
    <select name="lang">
      <?php foreach(Lang::fetchLanguage() as $lang):?>
      <option value="<?php echo $lang->abbr;?>"<?php if($core->lang == $lang->abbr) echo ' selected="selected"';?>><?php echo $lang->name;?></option>
      <?php endforeach;?>
    </select>
</div>

this is the refresh button code

<button type="button" name="dosubmit" class="wojo positive button">
    <?php echo Lang::$word->CONF_UPDATE;?>
</button>
<input name="processConfig" type="hidden" value="1" />

In my .php controller, I found this code

/* == Proccess Configuration == */
if (isset($_POST['processConfig'])):
    $core->processConfig();
endif;

What should I do to make this function work, the user can change the language himself?

if you need more information, feel free to ask me because I am really new to this world.

Sorry for my english, english using google translate

+4
source share
1 answer

You need to use a button like submit, you have a button type.

<button type="button" name="dosubmit" class="wojo positive button">

<button type="submit" name="dosubmit" class="wojo positive button">Value</button>
+1
source

All Articles