We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13226
    • 953 Posts
    Hello

    I've been asked to help build a site for a friend and have come to a grinding stop.

    I need to create a demo page which has a header and an iFrame, similar to those sites that have live demos of templates & themes e.g. ThemeForest.

    What my problem is:

    On each page where I want a demo to be linked I need a button / link that passes on the alias as a parameter

    There should only be one landing page for all demos, lets say "demo.php" and this should take the parameter sent from the link.

    The parameter needs to be the alias of the sending page.

    Example:

    mydomain.com/test.php has a link to mydomain.com/demo.php

    demo.php has an iFrame in it that has a pre-defined source path of "mydomain.com/demos/", so what I need the link to do is pass the alias to the pre-defined path.

    The end result should look something like: mydomain.com/demos/test/


    If anyone already has something like this or can help that would be great. I have no problem paying for a solution either.

    p.s. I have no programming knowledge / abilities [ed. note: iusemodx last edited this post 11 years, 9 months ago.]
      • 13226
      • 953 Posts
      Bump.

      I have spent most of the day researching and testing various JS solutions to no avail.

      I found this post but can't get it to work in the fashion I require.

      Any help is appreciated

      Cheers
        • 13226
        • 953 Posts
        Now have this sorted, or at least, I presume the code is safe to use. Any PHP savvy eyes just to check for safety would be appreciated.

        Thanks go out to a post from over 5 years ago from Breezer - can be found here