Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

keith_e on "Using $_SERVER['REQUEST_URI']"

$
0
0

Hi

I have two websites with exactly the same layout and structure, one is in English and the other is in French. I have put two buttons on each site to swap between the two. So if a visitor is on http://www.frenchsite.com/services and wants to go to the same page on the English site (www.englishsite.com/services), they click on the 'English' button.

I'm having difficulties with getting $_SERVER['REQUEST_URI'] to work properly.

I'm trying to use, for example, on the French site (www.frenchsite.com)
<a href="<?php ‘http://www.englishsite.com’.$_SERVER['REQUEST_URI']; ?>" id="flag"><img src="<?php bloginfo('template_url'); ?>/images/ausflag-50x25.png" title="English"></a>. to go to the equivalent page on the English site.

It doesn't construct the URL correctly. Instead it constructs http://www.frenchsite.com/services for example, rather than http://www.englishsite.com/services.

Some help please?

Cheers
Keith


Viewing all articles
Browse latest Browse all 8245

Trending Articles