• Resolved keith_e

    (@keith_e)


    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

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using $_SERVER['REQUEST_URI']’ is closed to new replies.