Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Retrieving complete URL from page ($_GET[?]?)

    I'm working on a mod to highlight the current page link in ez-pages menus, and used $_GET['url'] to compare the page url with the link url. This seemed to be successful in initial trials, but now doesn't work, and my research seems to show that it doesn't exist.

    What can I use to retrieve the complete current page URL? This may be a case of not using the right term to search with, as I would think it ought to be possible.
    Where can I find a more or less complete list of $_GET[] fields? Or does such a list exist? I have looked in the forum, the wiki and my site's DTK so far.

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    $_GET without square brackets or an index will return the entire array of parameters being passed. Does that help?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    Thanks for that! It might help, though reassembling all the right parameters in the right order would be a real pain. I don't suppose you know if the parameters are ordered in the same sequence they appear in the address bar? If they are, an implode() might possibly work? Or maybe not, as there are different delimiters between different parts of the URL, and things like "main_page=" would also have to be added back in.

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    The $_GET array is associative, so the order doesn't matter. URLs don't care about the order either.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    The point is that I have to compare a link string which could have a huge number of different components with the page URL it might have called, and it seems a nightmare to compare all possible link elements with URL elements.

  6. #6
    Join Date
    Jun 2008
    Location
    Washington, DC
    Posts
    789
    Plugin Contributions
    7

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    I have used $_SERVER['REQUEST_URI']


    Skip
    • 446F63746F722057686F •

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    Are you looking maybe for the zen_get_all_params() function which is used to rebuild a URL excluding any parameters passed in an array

    Example usage:
    PHP Code:
    zen_href_link($current_page_basezen_get_all_get_params(array('currency','language'))) 
    to strip the language and parameter params and give back what's left of the page's URL.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    AHA! I knew I had seen something that would show that. That's what it was. Thank you so much!


    Since the ez-page link will be in the form of a complete URL, comparing that with the actual page's complete URL will be easiest. It will be okay if the page URL runs longer than the link.

  9. #9
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    If this is for ezpages, don't you care only about the "main_page" and "page" parameters?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  10. #10
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Retrieving complete URL from page ($_GET[?]?)

    Oh I think I see. You're refering to to the URLs of EZ-Pages themselves, but to the URLs that they forward onto?
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. use SSL to complete order from another, different URL, that is not?
    By Johnnycopilot in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 20 Sep 2012, 10:02 PM
  2. where is the $_GET['referer'] from?
    By linjuming in forum General Questions
    Replies: 2
    Last Post: 27 Jun 2012, 09:25 PM
  3. Replies: 0
    Last Post: 12 Feb 2010, 07:10 PM
  4. retrieving old orders from admin folders
    By ShopShogun in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 11 Nov 2009, 07:06 PM
  5. Retrieving customers' passwords from DB
    By ckosloff in forum Managing Customers and Orders
    Replies: 4
    Last Post: 3 May 2008, 03:51 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg