Save to Session a Link and destroy another session to make site translation

Asked

Viewed 19 times

0

inserir a descrição da imagem aqui

How Can I Make You Click On A Flag It Records Your Language Data in a Session

  • Brazil ==> writes string ""
  • United States ==> saves to session the string "uses"

and by 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>

1 answer

0

This can be done with a request POST or GET (POST is more pleasant for the customer) simple. After receiving the request just save in SESSION user or even DB (if the user is logged in). I will not demonstrate the code because it is a very simple thing and you should be able to do the implementation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.