We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16653
    • 2 Posts
    oh my oh my oh my... i really hope someone can help me out here.

    I have a function that sets a variable to load a different css file depending on user input. Simple enough, but here is where the problem comes in. The user sets these variables with a get variable (not the only way I have tried to send the data) and the php will run my function and return them to the main page. This happens no matter what page they are looking at on the site. I have friendly urls turned on, so $_SERVER[’PHP_SELF’] is always set to index.php, while i really want them to return to the page they were on when they clicked on my link.

    Example.
    User is browsing on domain.com/home/learn/about_us, and clicks my link which is <a href=’?size=small’> and this returns them to domain.com after running the function. With friendly urls turned on, how do I get them to be returned to domain.com/home/learn/about_us?

    Please help! huh huh huh
      • 22303 MODX Staff
      • 10,725 Posts
      Try making the link <a href="[~[*id*]~]?size=small">, but what does PHP_SELF have to do with it?  Could you post your code?
        • 16653
        • 2 Posts
        you sir, are a genius.

        this will give me exactly what I want. Is there a certain part of the documentation that lists out internal functions like [~[*id*]~] somewhere? I was looking while waiting to see if anyone would respond. I’m new to modx and not familiar with editing my clients website.

        in regards to your other question, absoultly nothing at all. I was trying to use $_SERVER[’PHP_SELF’] to get the location of the content on a whim. This is what i really needed. thanks again. grin