Using $_SERVER['REQUEST_URI']
-
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 https://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 ‘https://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 https://www.frenchsite.com/services for example, rather than https://www.englishsite.com/services.
Some help please?
Cheers
Keith
- The topic ‘Using $_SERVER['REQUEST_URI']’ is closed to new replies.