0

Here is a link to switch text in english on my source code:

<a href="index.php?lang=en">Not french</a>

It works. But on the english text page, link still shows up "Not french". I want it display "Not english" when text is english.

2 Answers 2

1

Maybe some logic would be helpful?

<a href="index.php?lang=en">Not <?php if (isset($_GET['lang']) && $_GET['lang'] == 'en') {echo "French";} else {echo "English";} ?></a>

Your question is quite vague, so could you please explain what your problem is? Maybe some more code to place it into context?

1
if(isset($_GET['lang']) and $_GET['lang']=='en')
    echo '<a href="index.php">French</a>'
else
    echo '<a href="index.php?lang=en">Not french</a>'

Although I would recommend that you store lang in session to clean up you url's.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.