Making use of htaccess and Google translate I have buttons to several languages on my site that send the site to Google translate. This works OK.
However within Google-translate the same buttons e.g. to switch to another language don't work anymore because of the url has changed.
So my idea is to use PHP to check the url on the word Google so that the buttons are not shown when if it is found.
Is there a way within PHP to check if a particular word is part of the url?
Any help is greatly appreciated.
DVita wrote:
HTTP_HOST and SERVER_NAME don't help me out yet.
Gee that didn't help me out either.
How 'bout you provide the link to the page you inquring about and the code you're trying to use so others that might want to help you don't have to try and read your mind or take stab-in-the-dark guesses of a solution to your vague question?
best,
Shocker ![]()
Thanks for helping.
This is the site: http://www.designvitamine.nl/
It is in Dutch as you see. The language links are on the right.
The code to show or not show works when tested on another website (where it doesn't show) but not within Google Translate.
I also tried using HTTP_HOST as mentioned. The smily here is mistakenly created by this forum because I used : and ) together.
<?php if($_SERVER['SERVER_NAME'] == ('www.designvitamine.nl')) { ?>
<p id="translate">
<a href="http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>-en" target="_blank">English</a> -
<a href="http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>-de" target="_blank">Deutsch</a> -
<a href="http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>-fr" target="_blank">Français</a> -
<a href="http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>-es" target="_blank">Español</a> -
<a href="http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>-hu" target="_blank">Magyar</a> -
<a href="http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>-u" title="Your local language" target="_blank">
</a> -
<a href="dvita_translate.php">Hoe?</a>
</p>
<?php } ?>
Try to put Google Translate links directly into your code:
<p id="translate">
<a href="http://translate.google.com/translate?hl=en&sl=nl&http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>" target="_blank">English</a> -
<a href="http://translate.google.com/translate?hl=de&sl=nl&http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>" target="_blank">Deutsch</a> -
<a href="http://translate.google.com/translate?hl=fe&sl=nl&http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>" target="_blank">Français</a> -
<a href="http://translate.google.com/translate?hl=es&sl=nl&http://www.designvitamine.nl<?php echo $_SERVER['PHP_SELF']; ?>" target="_blank">Español</a> -
<a href="http://translate.google.com/translate?hl=hu&sl=nl&http://www.designvit amine.nl<?php echo $_SERVER['PHP_SELF']; ?>" target="_blank">Magyar</a> -
<a href="dvita_translate.php">Hoe?</a>
</p>
North America
Europe, Middle East and Africa
Asia Pacific