-1

I am having the following error message:

NOTICE Message: Undefined index: mode File: /includes/pages/game/class.ShowBonusPage.php Line: 14 URL: localhost/2moons/game.php?page=bonus PHP-Version: 5.2.6

Code is :

class ShowBonusPage extends AbstractPage {

function ShowBonusPage() {
global $USER, $PLANET, $LNG, $LANG, $db, $ressoucre, $reslist;
$PlanetRess = new ResourceUpdate();
$PlanetRess->CalcResource();
$PlanetRess->SavePlanetToDB();

$template    = new template();
$Mode = $_GET['mode'];
$darkmatter = $USER['darkmatter'];
$tecno = $USER['b_tech_planet'];
$minas = $PLANET['b_building_id'];
$buster = $PLANET['buster_tech'];
$metal = $PLANET['metal'];
$crystal = $PLANET['crystal'];
$deuterium = $PLANET['deuterium'];

The error line is:

    $Mode = $_GET['mode'];

Can anyone help me with this

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141

1 Answers1

0

You should user GET and POST in this manner:

$Mode='';
if(isset($_GET['mode'])){
    $Mode = $_GET['mode'];
}
Amit Garg
  • 3,867
  • 1
  • 27
  • 37