Jump to content

FlyingIsFun1217

Members
  • Posts

    178
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.MechGame.co.nr/

Profile Information

  • Gender
    Not Telling
  • Location
    Here

FlyingIsFun1217's Achievements

Member

Member (2/5)

0

Reputation

  1. Basically, the problem I have with any of these proposed solutions is that an error is thrown when I run the script and don't supply a GET variable in the URL (which is a possible case in real-world use). When the PHP interpereter sees that I am referencing $_GET['post'], and it has nothing in that GET array, it freaks out and throws me an error. Is this maybe just my server/PHP setup? FlyingIsFun1217
  2. So GET can be set, but still be empty? That would be the case with the "Page 1" if conditional. FlyingIsFun1217
  3. Hey, I'm trying to get a page that goes through different situations via the GET variable. Because of this, I need to be able to deal with not having anything in the GET array (if the user just goes to x.php). The way I have it now is something like such: if (!array_key_exists('page', $_GET) && !empty($_GET)) { //Put in template code for error page print 'Wrong GET name!'; } else { //Page 1 - Welcome, process explanation if($_GET['page'] == "1" || empty($_GET)) { //Page one output! print "Page 1 / Empty"; } } Now, I know there's something wrong here, in the fact that if I run the script without passing a GET variable, I get a warning/error, because $_GET['page'] isn't set. How can I get around this? Is there no way to supply results for both scenarios? Thanks FlyingIsFun1217
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.