ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How to pass an URL as parameter to an URL?

June 24, 2007 9:37am

Subscribe [3]
  • #1 / Jun 24, 2007 9:37am

    Patrick Savalle

    31 posts

    I would like to pass URL’s as parameters. So I can use it in a segment-variable.

    I tried something like this, putting the encoded URL in a URL-segment:

    <a href="http://zaplog.nl/nieuw/Horloge+van+bush+gerold/http&#x3A&#x2F&#x2Fzapruder.nl&#x2Fzaplog&#x2Fartikel&#x2Fhorloge_van_bush_gerold">http://zaplog.nl/nieuw/Horloge+van+bush+gerold/http://zapruder.nl/zaplog/artikel/horloge_van_bush_gerold</a>

    Where segment_2 = “Horloge van bush gerold”
    and segment_3 = “http://zapruder.nl/zaplog/artikel/horloge_van_bush_gerold/”

    But this doesn’t work. (Though I feel this ought to work)

    I need something else that works. I need to pass a page an URL. Maybe use ?param1=value&param2=value etc.  but how can I get to the full URL from a template?

  • #2 / Jun 24, 2007 9:40am

    Patrick Savalle

    31 posts

    Of course the last URL-segment looked like a correct /normal encoded URL before this forum software mutilated it.

  • #3 / Jun 25, 2007 11:36am

    Patrick Savalle

    31 posts

    Not possible?

  • #4 / Jun 25, 2007 1:15pm

    Derek Jones

    7561 posts

    I don’t believe that would be a URI that Apache would successfully process unless you were running ExpressionEngine with query strings enabled.  And in the latter case, you’d trigger an “Invalid URI” warning from ExpressionEngine, which would view that URL as a potential security threat.

    What specifically are you wanting to do?  In other words, how are you planning on this information finding its way into the URL, and how are you planning to use it on the target template?  The method I recommend will vary greatly depending on those two factors.

  • #5 / Jun 26, 2007 4:47pm

    Patrick Savalle

    31 posts

    I would like to pass an external URL to a template for a social bookmarking site I would like to build. A title and an URL.

  • #6 / Jun 26, 2007 5:30pm

    Derek Jones

    7561 posts

    If you’re using a Module, you could give its own Action, which would give you endpoint URLs like http://example.com/index.php?ACT=45&name=Example&url=http%3A%2F%2Fexample.com%2F

    If not, then you can send the data directly to a template via POST data.  This can be triggered from a regular link and not require a rendered form in the browser if you use some Javascript.  See FeedQuickStart for an idea of how to do this.

  • #7 / Jun 28, 2007 6:26am

    zapruder.nl

    1 posts

    Isn’t it possible to access to full URL including its parameters from a template? (using PHP?) I don’t mind writing some code to parse the URL.

    I need to populate a SAEF with some values that where passed from external websites by URL.

  • #8 / Jun 28, 2007 6:03pm

    Patrick Savalle

    31 posts

    I figured out this will work:

    <?php echo @getenv(‘PATH_INFO’) ; ?>
    <?php echo @getenv(‘QUERY_STRING’) ; ?>

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases