OK I will try and explain myself first off I am designing a site in oscommerce The site is mulit lingual and has 4 flags in a row representing different langauges All that works fine buy I would like to create my own drop down list for the menu and when you click on the link it translates the page It does this already but the code is quite complicated to edit and I cant figgure it out Currently when you click on the flag to translate the page it opens a new page lile this mydomain.com/contactus.php?language=en What I would like or need is code that will repon what ever the current page and add in that extra line of code so it will open "currentpage?language=en Is this posible with code PHP or javascript or anything else Also I would need to add in an IF or ELSE statement saying something like If page url="mydomain.com" open mydomain.com/index.php?language=en else open currenturl +?language=en Thanks to anyone who can help
echo $_SERVER['PHP_SELF'] . "?language=" . $selectedlanguage; That'll be 5 dollars. Haha kidding. Honestly, I'm not sure if that's what you were looking for, but it's what I gathered from your post. $_SERVER['PHP_SELF'] will always output /currentpage.php
If I understand your question correctly, you would do something like <a href="<?php echo $_SERVER['PHP_SELF'] . "?language=" . $selectedlanguage; ?>">Your link in english</a>
Thanks that is great Is it possible to place the if statement in that as well I really need to learn to type
Have you tried it yet? You shouldn't need an if statement. When you're on www.mydomain.com, PHP_SELF should point right to index.php (unless you changed configs to a different name of index).