Language "switch" button

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Minus
Forum Newbie
Posts: 1
Joined: Tue Sep 29, 2009 11:33 am

Language "switch" button

Post by Minus »

Hello. I’m new to PHP and I have a little question.

I’m building a website with both ENGLISH and FRENCH side. Both sides are a "mirror" of each other. By that I mean that all the pages a placed at the same place. For example:

http://www.MySite.com/english/contact/index.html
http://www.MySite.com/french/contact/index.html


What I would like to achieved is to have a "French Version" or "English version" button, depending on the side you’re on. What I would like to do, if it’s possible, is to have the script check the current URL and simply replace the "/english" part by "/french" and vice versa, of the button’s link.

I currently use a JavaScript that does something like it; the problem is that the link cannot be seen by search engine.

Any idea?
User avatar
akuji36
Forum Contributor
Posts: 190
Joined: Tue Oct 14, 2008 9:53 am
Location: Hartford, Connecticut

Re: Language "switch" button

Post by akuji36 »

Take a look at this post--Php

may have an answer: _SERVER global variable:

http://coding.derkeiler.com/Archive/PHP ... 00915.html

thanks

Rod
Post Reply