Jump to content

Undefined index error


cactus

Recommended Posts

Hi,

 

I'm trying to create a cms and keep getting an undefined index:action error message.

I tried to use isset but then it just threw out a different error.

The section of code that is causing the errors is:

 

if ( $_GET['action'] != "login" && $_GET['action'] != "logout" && !$_SESSION['username'] ){ //ITS SHOWING 2 ERRORS WITH ACTION ON THIS LINE

  login();

  exit;

}

 

switch ( $_GET['action'] ) {  //IT ALSO HAS AN ERROR FOR ACTION ON THIS LINE

  case 'login':

    login();

    break;

  case 'logout':

    logout();

    break;

 

I would really appreciate the help as it's been annoying me and i'm having a mental blog.

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/229977-undefined-index-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.