Grow your CSS skills. Land your dream job.

Using just ‘?’

  • # September 20, 2009 at 8:15 pm

    Hey all, I was wondering how one gets PHP pages using $_GET working with just the question mark, e.g.

    And I’ve got this page to test it:

    Code:
    < ?php
    if(!empty($_GET)) {
    echo $_GET;
    }
    else {
    echo 'no dice';
    }
    ?>

    And when I add the "?article1" to the URL it just echoes "Array", but when I don’t it just says "no dice".

    Any suggestions?

    # September 21, 2009 at 3:39 pm

    you need to set it equal to something..

    and to display what article is equal to, you need…

    Code:
    < ?php
    if(!empty($_GET)) {
    echo $_GET['article'];
    }
    else {
    echo 'no dice';
    }
    ?>
    # September 21, 2009 at 3:58 pm

    Oh. Well, that’s a let down. Thanks for taking the time anyways.

    # September 21, 2009 at 6:47 pm

    well, this is just to the best of my knowledge.. there probably is a way to do what you’re trying to do..

    since it’s an Array, you can try

    Code:
    print_r ($_GET);
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".