Write to the Session of a Linked Link and destroy another session to do site translation

0

HowcanIdothatwhenclickingonsomeflagitsavesinasessionthedatareferringtoitslanguage

  • Brazil==>writesinthesessionthestring"br"
  • United States == > writes in the session the string "uses"

and clicking on one destroy the other

Estou indo por esse principio mais não sei se é o correto
lng = $_REQUEST['lng'];
$_SESSION['lng'] = $lng; 


<a href="<?echo $nome_do_arquivo?>?lng=br"><img src="img/br.jpg" width="28" 
height="16" alt="Image" data-retina="true"/></a>

<a href="<?echo $nome_do_arquivo?>?lng=usa"><img src="img/lang_en.png" 
width="28" height="16" alt="Image" data-retina="true"/></a>

<a href="<?echo $nome_do_arquivo?>?lng=fran"><img src="img/lang_fr.png"  
width="28" height="16" alt="Image" data-retina="true"/></a>

<a href="<?echo $nome_do_arquivo?>?lng=spain"><img src="img/lang_es.png" 
width="28" height="16" alt="Image" data-retina="true"/></a>
    
asked by anonymous 05.10.2017 / 20:07

1 answer

0

This can be done with a request POST or GET ( POST is more pleasing to the client) simple. After receiving the request, simply save it in the SESSION of the user or even in the DB (if the user is logged in). I will not demonstrate the code as it is a fairly simple thing and you should be able to do the implementation.

    
06.10.2017 / 00:43