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.

Global Vars Array... Query String vs Path Info

September 30, 2010 12:30am

Subscribe [3]
  • #1 / Sep 30, 2010 12:30am

    apticknor

    1 posts

    Hello!

    I’ve been having some issues trying to get a global var to get the right data. I’m using EE 1.6.9 and building with structure, and strict urls are on. In an attempt to create year filtering on my entries, I’m creating urls likes this:

    http://www.minnesotawineclub.com/news/?year=2009

    This has worked in the past on many sites I’ve developed by adding the following code to the path.php file.

    $global_vars = array(
        'get:year' => isset($_GET['year']) ? $_GET['year'] : null
    );

    However, the variable is always returning null. Upon further inspection, I’ve noticed any $_GET I attempt is not returning a value. I’m wondering if this has anything to do with the server I’m on (my first EE site on this server) and the URI Type. I’m currently set to auto (0) as I normally have in the past.

    Any insight that could be provided by anyone would be most helpful.

    Thank You!

    - Anthony

  • #2 / Sep 30, 2010 11:05pm

    Brandon Jones

    5500 posts

    Hi Anthony, and welcome to the forums!

    The first thing I’d do is disable your .htaccess file by renaming it, and then set your site’s index page in General Configuration back to ‘index.php’. Do your GET variables come through then?

  • #3 / Oct 01, 2010 12:37am

    apticknor

    1 posts

    That’s where I started and shortly there after I found out my host wasn’t supporting path_info which was why I had to use query string. After some research in the forums I found a way to use ORIG_PATH_INFO instead of PATH_INFO in my index.php file. Then things started working perfectly!

    Yeesh. I’ve done a few EE sites and PATH_INFO has always worked. Glad to know this workaround.

    - Anthony

  • #4 / Oct 01, 2010 3:42am

    Ingmar

    29245 posts

    Very glad to hear that. Please post again as needed.

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

ExpressionEngine News!

#eecms, #events, #releases