I'm trying to add a cookie banner to my website and it has two different languages: Italian and English.
Language goes as
http://www.grcparfum.it/home.php?section=letteradelpresidente&lang=eng
and
http://www.grcparfum.it/home.php?section=letteradelpresidente&lang=ita
and this is my code:
<?php
$currentlang= $_GET['link'];
if($currentlang !=eng){
?>
<script src="/js/cookiechoices-en.js"></script>
}
<?php else: ?>{
<script src="/js/cookiechoices-it.js"></script>
<?php endif; ?>
}
Problems you're probably encountering:
==
for the firstif
statement not!=
.eng
with$currentlang
rather than"eng"
Try:
I'm assuming it's never picking the
eng
option.I think your bug is not putting
eng
in quotes:Should be
Do this using JQuery: