We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7690
    • 166 Posts
    I have a frustrating problem.
    I have 4 pages and each page has a link to the same page but with an id in the link.
    example:
    <a href="www.test.com/index.php?id=20&v=2">test</a>

    At the id 20 page I have this snippet:
    <?php
    if(isset($_GET['v'])) {
    
    $page = $_GET['v'];
    
    if($page == "1"){
    echo "<a href=\"http://www.x.nl/1\" id=\"afspreken2\">test</a>";
    } else if ($page == "2"){
    echo "<a href=\"http://www.x.nl/2\" id=\"afspreken2\" >test</a>";
    } else if ($page == "3"){
    echo "<a href=\"http://www.x.nl/3\" id=\"afspreken2\">test</a>";
    } else if ($page == "4"){
    echo "<a href=\"http://www.x.nl/4\" id=\"afspreken2\">test</a>";
    }
    
    
    } else { 
    echo "<a href=\"http://www.x.nl/99\">test</a>";
    }
    ?>


    But this doesn’t work somehow...
    However if i paste the script in a new page outside of modx, it works.
    Somehow modx blocks it?
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      Are you using any special .htaccess modifications that mess around with your query strings? What happens if you print out the $_SERVER["QUERY_STRING"]?
        • 22303 MODX Staff
        • 10,725 Posts
        Did you call it uncached? Otherwise, only the first access to the page will even look at the $_GET vars or any other request-specific data.
          • 7690
          • 166 Posts
          Quote from: OpenGeek at Apr 14, 2010, 04:00 PM

          Did you call it uncached? Otherwise, only the first access to the page will even look at the $_GET vars or any other request-specific data.

          OMG, thank you so much. Such a dumb mistake.